Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
张浩
/
BrBigDataTest
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit
bc2af192
...
bc2af192021737534661770f80839e72a61176f3
authored
2022-01-06 16:24:40 +0800
by
zhanghao
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
commit
1 parent
c23aa6f9
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
23 additions
and
6 deletions
run_linux.sh
shell/biz_data_count.hql
shell/biz_data_response.hql
shell/create_table.hql
shell/load_data.hql
shell/method_count.hql
run_linux.sh
View file @
bc2af19
...
...
@@ -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'
...
...
shell/biz_data_count.hql
View file @
bc2af19
...
...
@@ -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
...
...
shell/biz_data_response.hql
0 → 100755
View file @
bc2af19
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
shell/create_table.hql
View file @
bc2af19
...
...
@@ -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,
...
...
shell/load_data.hql
View file @
bc2af19
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
...
...
shell/method_count.hql
0 → 100755
View file @
bc2af19
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
Please
register
or
sign in
to post a comment