Commit bc2af192 bc2af192021737534661770f80839e72a61176f3 by zhanghao

commit

1 parent c23aa6f9
......@@ -9,11 +9,14 @@ hadoop jar ./target/BrBigDataTest-1.0.0.jar com.bigdata.test.ETLApp /input/data/
sleep 3
hive -f ./shell/load_data.hql
hive -f ./shell/method_count.hql
hive -f ./shell/biz_data_count.hql
hadoop fs -rm /input/data/$time
rm ../$time
sqoop export --connect jdbc:mysql://127.0.0.1:3306/bigdata --username root --password zidonghua --table method_count --export-dir /user/hive/warehouse/testdb.db/method_count --input-fields-terminated-by '\t'
sleep 3
sqoop export --connect jdbc:mysql://127.0.0.1:3306/bigdata --username root --password zidonghua --table biz_data_count --export-dir /user/hive/warehouse/testdb.db/biz_data_count --input-fields-terminated-by '\t'
sleep 3
sqoop export --connect jdbc:mysql://127.0.0.1:3306/bigdata --username root --password zidonghua --table biz_data_response --export-dir /user/hive/warehouse/testdb.db/biz_data_response --input-fields-terminated-by '\t'
......
......@@ -4,9 +4,4 @@ INSERT INTO TABLE biz_data_count
select method,biz_data,count(1) as count,max(timestamp) as timestamp
from qa_log
where method='com.ai.handler.plan.detail.index.info'
group by method,biz_data;
INSERT INTO TABLE biz_data_response
select method,biz_data,uid,timestamp,response
from qa_log
where method='com.ai.handler.plan.detail.index.info';
\ No newline at end of file
group by method,biz_data;
\ No newline at end of file
......
use testdb;
INSERT INTO TABLE biz_data_response
select method,biz_data,uid,timestamp,response
from qa_log
where method='com.ai.handler.plan.detail.index.info';
\ No newline at end of file
......@@ -14,6 +14,12 @@ trace string,
timestamp string
) ROW FORMAT DELIMITED FIELDS TERMINATED BY '\t';
CREATE TABLE method_count(
method string,
count string,
timestamp string
) ROW FORMAT DELIMITED FIELDS TERMINATED BY '\t';
CREATE TABLE biz_data_count(
method string,
biz_data string,
......
use testdb;
truncate table qa_log;
truncate table method_count;
truncate table biz_data_count;
truncate table biz_data_response;
LOAD DATA INPATH 'hdfs://localhost:8020/input/etl' OVERWRITE INTO TABLE qa_log;
\ No newline at end of file
......
use testdb;
INSERT INTO TABLE method_count
select method,count(1) as count,max(timestamp) as timestamp
from qa_log
group by method;
\ No newline at end of file