【问题标题】:Hive ParseException - cannot recognize input in Select ClauseHive ParseException - 无法识别 Select Clause 中的输入
【发布时间】:2014-12-04 10:07:46
【问题描述】:

我正在尝试在 hive 中编写 Union All 查询。以下是我的查询

Create table test.Final_Union_Table as
    Select xyz.column_1,xyz.column_2,xyz.column_3
        From (
        Select a.column_1, a.column_2, a.column_3
                From test.Union_table1 a
                Union All
                Select b.column_1, b.column_2, b.column_3
                From test.Final_Table b)xyz;

我收到以下错误

ParseException line 2:0 cannot recognize input near 'z' '.' 'Column_1' in select clause

在此不胜感激。

谢谢。

【问题讨论】:

    标签: hadoop hive bigdata hiveql


    【解决方案1】:

    我觉得你的问题是对的,试试这个

    Create table test.Final_Union_Table as
        Select column1,column2,column3
            From (
            Select a.column_1 as column1, a.column_2 as column2, a.column_3 as column3
                    From test.Union_table1 a
                    Union All
                    Select b.column_1 as column1, b.column_2 as column2, b.column_3 as column3
                    From test.Final_Table b)xyz;
    

    注意 - 两个表中特定列的数据类型应相同,例如 a.column_1 和 b.column_1 应具有相同的数据类型;

    【讨论】:

      猜你喜欢
      • 2022-12-21
      • 2013-09-09
      • 2019-11-17
      • 2018-04-25
      • 2023-03-29
      • 1970-01-01
      • 2023-02-20
      • 2019-02-03
      • 1970-01-01
      相关资源
      最近更新 更多