-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun-module.sh
73 lines (63 loc) · 1.69 KB
/
run-module.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#!/bin/sh
# Load the until files
scripts_path=$(dirname $(readlink -f "$0"))
source "${scripts_path}/bash/utils/common-functions.sh"
source "${scripts_path}/bash/hadoop/hive.sh"
# Parse args
read_args $@
function display_hive_help() {
echo
echo "Usage: hive util module [option...] f={loc|schema}" >&2
echo
echo " f=loc|l, To get the hive table hdfs storage location"
echo " params, additional parameter required"
echo " * db={hive database name}"
echo " * table={hive table name}"
echo " f=schema|sch, To get the hive table schema"
echo " params, additional parameter required"
echo " * db={hive database name}"
echo " * table={hive table name}"
echo
exit 1
}
# The command line help
function display_help() {
echo
echo "Usage: $0 [option...] m={hive|hdfs|hbase}" >&2
echo
echo "++++++++++++++++++++: Hive Features :++++++++++++++++++++++"
display_hive_help
echo
echo echo "++++++++++++++++++++: Hive Features :++++++++++++++++++++++"
echo " display, hadoop-hbase module feature"
echo
exit 1
}
# check for the main parameter
case "$m" in
"hive")
info "Bash Hadoop-Hive Module..."
case "$f" in
"loc" | "l")
get_hive_table_location $db $table
;;
"schema" | "sch")
get_hive_table_schema $db $table
;;
*)
# echo show all the hive util features
display_hive_help
;;
esac
;;
"hdfs")
info "Bash Hadoop-hdfs Module..."
;;
"hbase")
info "Bash Hadoop-Hive Module..."
;;
*)
# echo help options
display_help
;;
esac