【问题标题】:output/echo a meesage in hql/ hive query language以 hql/hive 查询语言输出/回显消息
【发布时间】:2015-02-24 18:25:08
【问题描述】:

我需要如下创建一个hive.hql。

HIVE.hql:

select * from tabel1;
select * from table2;

我的问题是:我可以在创建表一之后在 hql 代码中将任何消息回显到我的控制台,例如“从 table1 获得结果”

select * from tabel1;
echo/print/output ("table 1 results obtained");
select * from table2;

【问题讨论】:

    标签: hadoop hive


    【解决方案1】:

    在 *.hql 文件中,在两个 hive 查询之间插入如下一行。

    !echo "table 1 results obtained"; 
    

    【讨论】:

      【解决方案2】:

      您可以通过编辑 HIVE.hql 添加评论:

      select * from tabel1;
      !sh echo "table 1 results obtained";
      select * from table2;
      

      【讨论】:

        【解决方案3】:

        在直线上只需使用下面的

        --add your comment after 2 hypens and its printed in the console
        

        其他解决方案不起作用,可能在当前版本中已删除

        【讨论】:

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