【问题标题】:Logging messages in Hive .hql file在 Hive .hql 文件中记录消息
【发布时间】:2017-03-28 22:10:43
【问题描述】:

我有一些插入语句要在 Hive 中运行。我打算将它们放在 .hql 文件中并通过 beeline -f 选项运行它。有没有办法可以在插入之间回显一些日志消息,以便我知道进度。喜欢:

echo "开始插入......" 插入1

echo "插入 1 完成"

插入2

echo "插入脚本完成"

我尝试使用 linux shell 命令 echo as 来放置 echo 语句 !echo ""

但它没有将 echo 识别为命令

【问题讨论】:

    标签: hive hiveql beeline


    【解决方案1】:

    !sh 回声 ...


    !sh echo "Starting the inserts ........."      
    
    insert ...
    
    !sh echo "Insert 1 complete"
    
    insert ...
    
    !sh echo "Insert script is complete"
    

    【讨论】:

      【解决方案2】:
      set msg = "Starting Insert";
      set msg;
      
      insert into .... ;
      
      set msg = "Insert complete";
      set msg;
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2020-03-11
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2020-06-20
        • 1970-01-01
        相关资源
        最近更新 更多