Hive ParseException - 无法识别Select子句中的输入

时间:2014-12-04 10:07:47

标签: hadoop hive bigdata hiveql

我试图在配置单元中编写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

在此感谢一些帮助和指导。

感谢。

1 个答案:

答案 0 :(得分:0)

我认为你的查询是对的,试试这个

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应具有相同的数据类型;