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
dcfd85a0
Commit
dcfd85a0
authored
Jul 07, 2020
by
赵建伟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
del old hive shell
parent
28c56446
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
35 deletions
+0
-35
hive.sh
lib/shell/hive.sh
+0
-35
No files found.
lib/shell/hive.sh
deleted
100755 → 0
View file @
28c56446
#!/bin/bash
# 定义变量方便修改
#hive="/opt/spark/spark-2.4.5-bin-hadoop2.7/bin/beeline -u jdbc:hive2://bj-gm-prod-cos-datacenter003:10010 -n data"
hive
=
"/opt/hive/hive-1.1.0-cdh5.16.1/bin/beeline -u jdbc:hive2://bj-gm-prod-cos-datacenter005:10000 -n data"
#至少输入一个参数 第一个参数为需求码(必选项),第二个参数为分区日期(可选)
if
[
$#
-lt
1
]
;
then
echo
"Param project_name lost, please check again!"
exit
0
fi
#判断sql脚本是否存在
dir_name
=
$1
sql_path
=
"/home/bi/bi-report/sqls/
$dir_name
/
$dir_name
.sql"
if
[
!
-f
$sql_path
]
;
then
echo
"Param project_name error, please check again!"
exit
0
fi
# 如果是输入的日期按照取输入日期;如果没输入日期取当前时间的前一天
if
[
-n
"
$2
"
]
;
then
partition_date
=
$2
else
partition_date
=
`
date
--date
=
"-1 day"
+%Y%m%d
`
fi
#参数替换
tmp_sql
=
`
cat
${
sql_path
}
`
sql
=
${
tmp_sql
//
'${partition_day}'
/
${
partition_date
}}
echo
-e
"
${
sql
}
"
#执行sql
$hive
-e
"
$sql
"
\ 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