shell 有用的
来源:互联网 发布:古天乐捐学校知乎 编辑:程序博客网 时间:2024/06/05 12:00
mysql -h192.168.206.191 -uhive -phadoophive -e "select a.NAME,b.tbl_name from DBS a join TBLS b on a.DB_ID=b.DB_ID" hive>1.txt
awk '{print $1","$2}' 1.txt>gettbname`date +%y%m%d`
# set up configurations
source benchmark.conf;if [ -e "$LOG_FILE" ]; then
timestamp=`date "+%F-%R" --reference=$LOG_FILE`
backupFile="$LOG_FILE.$timestamp"
mv $LOG_FILE $LOG_DIR/$backupFile
fi
echo ""
echo "***********************************************"
echo "* PC-H benchmark on Hive *"
echo "***********************************************"
echo " "
echo "Running Hive from $HIVE_HOME" | tee -a $LOG_FILE
echo "Running Hadoop from $HADOOP_HOME" | tee -a $LOG_FILE
echo "See $LOG_FILE for more details of query errors."
echo ""
trial=0
while [ $trial -lt $NUM_OF_TRIALS ]; do
trial=`expr $trial + 1`
echo "Executing Trial #$trial of $NUM_OF_TRIALS trial(s)..."
for query in ${HIVE_TPCH_QUERIES_ALL[@]}; do
echo "Running Hive query: $query" | tee -a $LOG_FILE
$TIME_CMD $HIVE_CMD -f $BASE_DIR/$query 2>&1 | tee -a $LOG_FILE | grep '^Time:'
returncode=${PIPESTATUS[0]}
if [ $returncode -ne 0 ]; then
echo "ABOVE QUERY FAILED:$returncode"
fi
done
done # TRIAL
echo "***********************************************"
echo ""
########################################################
#!/usr/bin/env bash
BASE_DIR=`pwd`
TIME_CMD="/usr/bin/time -f Time:%e"
NUM_OF_TRIALS=1
LOG_FILE="benchmark.log"
LOG_DIR="$BASE_DIR/logs"
# hadoop
HADOOP_CMD="$HADOOP_HOME/bin/hadoop"
# hive
HIVE_CMD="$HIVE_HOME/bin/hive"
# hive tpch queries
# hive all benchmark queries
IVE_TPCH_QUERIES_ALL=( \
"tpch/q1_pricing_summary_report.hive" \
"tpch/q2_minimum_cost_supplier.hive" \
"tpch/q3_shipping_priority.hive" \
"tpch/q4_order_priority.hive" \
"tpch/q5_local_supplier_volume.hive" \
"tpch/q6_forecast_revenue_change.hive" \
"tpch/q7_volume_shipping.hive" \
"tpch/q8_national_market_share.hive" \
"tpch/q9_product_type_profit.hive" \
"tpch/q10_returned_item.hive" \
"tpch/q11_important_stock.hive" \
"tpch/q12_shipping.hive" \
"tpch/q13_customer_distribution.hive" \
"tpch/q14_promotion_effect.hive" \
"tpch/q15_top_supplier.hive" \
"tpch/q16_parts_supplier_relationship.hive" \
"tpch/q17_small_quantity_order_revenue.hive" \
"tpch/q18_large_volume_customer.hive" \
"tpch/q19_discounted_revenue.hive" \
"tpch/q20_potential_part_promotion.hive" \
"tpch/q21_suppliers_who_kept_orders_waiting.hive" \
"tpch/q22_global_sales_opportunity.hive" \)
$HIVE_HOME/bin/hive -e 'select a.col from ${HIVE_TPCH_QUERIES_ALL[@]};'
0 0
- 有用的shell工具
- shell 有用的
- 一些有用的shell指令
- 几个有用的shell参数
- 有用的shell命令集锦
- 一个有用的shell脚本
- 一些簡單卻有用的Solaris Shell
- linux 下 shell 有用的常识
- shell之有用的网址1
- Linux下一些有用的Shell命令
- android shell下非常有用的指令
- 备忘几个有用的shell脚本
- 几个有用的Shell别名和函数
- 几个非常有用的shell命令
- [shell] 一些好玩或者可能有用的shell命令
- shell字符出替换的有用的几个命令
- unix shell 有用网址
- 很有用的shell / python 脚本片段(记录)
- hibernate简单多对一实例
- 我对透明的理解
- Apache+Tomcat+mod_jk实现集群和负载均衡问题解决
- MYSQL 之 on duplicate key update
- soft ap && wifi client
- shell 有用的
- logcat 不输出的解决方案
- JAVA正则表达式 Pattern 和 Matcher
- 淘宝的双11架构
- Android系统烧写
- 一个计算机专业学生的疯狂咆哮!学计算机的,你们伤不起!
- 性能测试工具搜集列表---工欲善其事必先利其器
- MongoDB如何存储数据
- cuda:在GPU内存中生成带有指针的结构体