记录Hive另外几种方式的使用
➜ hive-1.1.0-cdh5.7.0 bin/hive -help
readlink: illegal option -- f
usage: readlink [-n] [file ...]
usage: hive
-d,--define <key=value> Variable subsitution to apply to hive
commands. e.g. -d A=B or --define A=B
--database <databasename> Specify the database to use
-e <quoted-query-string> SQL from command line
-f <filename> SQL from files
-H,--help Print help information
--hiveconf <property=value> Use value for given property
--hivevar <key=value> Variable subsitution to apply to hive
commands. e.g. --hivevar A=B
-i <filename> Initialization SQL file
-S,--silent Silent mode in interactive shell
-v,--verbose Verbose mode (echo executed SQL to the
console)
第一种是使用shell的方式:
echo 'show databases;'|hive -S
第二种方式:比较适合于测试
hive -S -e 'show databases;'
第三种方式:建议使用
bin/hive -f /home/bigdata/testdata/a.sql
a.sql:
show databases;
还没有评论,来说两句吧...