记录Hive另外几种方式的使用

我就是我 2022-02-02 22:41 252阅读 0赞
  1. hive-1.1.0-cdh5.7.0 bin/hive -help
  2. readlink: illegal option -- f
  3. usage: readlink [-n] [file ...]
  4. usage: hive
  5. -d,--define <key=value> Variable subsitution to apply to hive
  6. commands. e.g. -d A=B or --define A=B
  7. --database <databasename> Specify the database to use
  8. -e <quoted-query-string> SQL from command line
  9. -f <filename> SQL from files
  10. -H,--help Print help information
  11. --hiveconf <property=value> Use value for given property
  12. --hivevar <key=value> Variable subsitution to apply to hive
  13. commands. e.g. --hivevar A=B
  14. -i <filename> Initialization SQL file
  15. -S,--silent Silent mode in interactive shell
  16. -v,--verbose Verbose mode (echo executed SQL to the
  17. console)

第一种是使用shell的方式:

  1. echo 'show databases;'|hive -S

第二种方式:比较适合于测试

  1. hive -S -e 'show databases;'

第三种方式:建议使用

  1. bin/hive -f /home/bigdata/testdata/a.sql
  2. a.sql:
  3. show databases;

发表评论

表情:
评论列表 (有 0 条评论,252人围观)

还没有评论,来说两句吧...

相关阅读