Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
B
bi-report
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
data
bi-report
Commits
0922af17
Commit
0922af17
authored
Apr 24, 2020
by
赵建伟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update codes
parent
8d445002
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
23 additions
and
12 deletions
+23
-12
menu.sh
bin/menu.sh
+0
-2
step1.job
jobs/demo/step1.job
+4
-0
step2.job
jobs/demo/step2.job
+5
-0
demo_param.zip
jobs/demo_param/demo_param.zip
+0
-0
hive2hive.sh
lib/shell/hive2hive.sh
+14
-10
No files found.
bin/menu.sh
deleted
100755 → 0
View file @
8d445002
#!/bin/bash
jobs/demo/step1.job
0 → 100644
View file @
0922af17
#step1.job
type=command
command=sh /srv/apps/bi-report/lib/shell/waitsuccess.sh hive online ml_device_day_active_status 20200423
\ No newline at end of file
jobs/demo/step2.job
0 → 100644
View file @
0922af17
#step2.job
type=command
dependencies=step1_1,step1_2,step1_3,step1_4,step1_5,step1_6
command=sh /srv/apps/bi-report/lib/shell/hive2hive.sh demo
\ No newline at end of file
jobs/demo_param/demo_param.zip
0 → 100644
View file @
0922af17
File added
lib/shell/hive2hive.sh
View file @
0922af17
...
...
@@ -10,6 +10,10 @@ fi
#默认取输入的账期
V_DATE
=
$2
partition_date
=
`
date
+
"%Y%m%d"
`
timestamp
=
`
date
+
"%Y%m%d%H%M%S"
`
tmp_file_name
=
"/data/bi-report/tmp/tmp_"
$timestamp
".sql"
result_file_name
=
"/data/bi-report/result/"
$1
"_"
$partition_date
".csv"
#输入的账期为空,则取T+1默认账期
if
[
-z
${
V_DATE
}
]
;
then
...
...
@@ -41,17 +45,16 @@ echo "V_7DAY_M_D_AGO: "$V_7DAY_M_D_AGO
echo
"************************************"
echo
""
#cp sqls/$1".sql" tmp.sql
cp
$1
tmp.sql
sed
-i
"s/
\$
V_PARYMD/
$V_PARYMD
/g"
tmp.sql
sed
-i
"s/
\$
V_PARY_M_D/
$V_PARY_M_D
/g"
tmp.sql
sed
-i
"s/
\$
V_1DAYMD_AGO/
$V_1DAYMD_AGO
/g"
tmp.sql
sed
-i
"s/
\$
V_7DAYMD_AGO/
$V_7DAYMD_AGO
/g"
tmp.sql
sed
-i
"s/
\$
V_1DAY_M_D_AGO/
$V_1DAY_M_D_AGO
/g"
tmp.sql
sed
-i
"s/
\$
V_7DAY_M_D_AGO/
$V_7DAY_M_D_AGO
/g"
tmp.sql
cp
"/srv/apps/bi-report/sqls/"
$1
".sql"
$tmp_file_name
sed
-i
"s/
\$
V_PARYMD/
$V_PARYMD
/g"
$tmp_file_name
sed
-i
"s/
\$
V_PARY_M_D/
$V_PARY_M_D
/g"
$tmp_file_name
sed
-i
"s/
\$
V_1DAYMD_AGO/
$V_1DAYMD_AGO
/g"
$tmp_file_name
sed
-i
"s/
\$
V_7DAYMD_AGO/
$V_7DAYMD_AGO
/g"
$tmp_file_name
sed
-i
"s/
\$
V_1DAY_M_D_AGO/
$V_1DAY_M_D_AGO
/g"
$tmp_file_name
sed
-i
"s/
\$
V_7DAY_M_D_AGO/
$V_7DAY_M_D_AGO
/g"
$tmp_file_name
# 新标签与新标签对应集合类型 的对应关系
/opt/hive/hive-1.1.0-cdh5.16.1/bin/beeline
-u
jdbc:hive2://bj-gm-prod-cos-datacenter004:10000
-n
data
-e
"
`
cat
tmp.sql
`
"
rm
-rf
tmp.sql
/opt/hive/hive-1.1.0-cdh5.16.1/bin/beeline
-u
jdbc:hive2://bj-gm-prod-cos-datacenter004:10000
-n
data
-e
"
`
cat
$tmp_file_name
`
"
>
$result_file_name
rm
-rf
$tmp_file_name
exit
0
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment