【问题标题】:Run a hive script stored in a HDFS location运行存储在 HDFS 位置的配置单元脚本
【发布时间】:2017-03-08 23:57:04
【问题描述】:

我正在尝试运行存储在 HDFS 位置 (hdfs://nameservice1/user/neeraj) 中的配置单元脚本(.hql 文件),但我找不到正确的命令来执行它。有没有办法直接从 HDFS 位置运行它,而不是将它移动到我的 /home/ 位置?

【问题讨论】:

  • 不认为你能做到这一点,你为什么要将脚本存储在 HDFS 中?

标签: hadoop hive hdfs


【解决方案1】:
hive -f <(hdfs dfs -cat /tmp/my_script.sql)

演示

cat>my_script.sql
select 1+1 as result;

hdfs dfs -put my_script.sql /tmp

hive -f <(hdfs dfs -cat /tmp/my_script.sql)

Logging initialized using configuration in file:/etc/hive/conf.dist/hive-log4j.properties
hive> select 1+1 as result;
OK
2

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2017-03-30
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多