parseexception行6:5无法识别joinsource中“(”select“”system“附近的输入

4urapxun  于 2021-05-29  发布在  Hadoop
关注(0)|答案(1)|浏览(811)

我正在尝试在配置单元中执行查询并得到错误。我反复检查,但看不出有什么问题。

CREATE view sta_v_clean_phrase_longtext (system, `function`, loglockmod, extinfo 
, primarykey, foreignkey, flgprimkey, flgfrgnkey, ref_recn, text_line, copied, 
inserted ) 
AS 
  SELECT system, 
         `function`, 
         loglockmod, 
         extinfo, 
         primarykey, 
         foreignkey, 
         flgprimkey, 
         flgfrgnkey, 
         ref_recn, 
         Concat_ws('', Collect_list(text_line))AS TEXT_LINE, 
         copied 
  FROM  (SELECT system, 
                `function`, 
                loglockmod, 
                extinfo, 
                primarykey, 
                foreignkey, 
                flgprimkey, 
                flgfrgnkey, 
                ref_recn, 
                text_line, 
                copied 
         FROM   phrase_longtext_orc_orc 
         WHERE  primarykey IS NOT NULL 
         GROUP  BY system, 
                   `function`, 
                   loglockmod, 
                   extinfo, 
                   primarykey, 
                   foreignkey, 
                   flgprimkey, 
                   flgfrgnkey, 
                   ref_recn, 
                   text_line, 
                   copied) 
  GROUP  BY system, 
            `function`, 
            loglockmod, 
            extinfo, 
            primarykey, 
            foreignkey, 
            flgprimkey, 
            flgfrgnkey, 
            ref_recn, 
            text_line, 
            copied

parseexception行6:5无法识别joinsource中“(”选择“系统”)附近的输入

dxxyhpgq

dxxyhpgq1#

保留您的别名 subquery 在CREATEVIEW语句中有额外的列 inserted 在select查询中不存在的列(我已经从下面的查询中删除了额外的列)。

hive> CREATE view sta_v_clean_phrase_longtext (system, `function`, loglockmod, extinfo 
, primarykey, foreignkey, flgprimkey, flgfrgnkey, ref_recn, text_line, copied) 
AS 
  SELECT system, 
         `function`, 
         loglockmod, 
         extinfo, 
         primarykey, 
         foreignkey, 
         flgprimkey, 
         flgfrgnkey, 
         ref_recn, 
         Concat_ws('', Collect_list(text_line))AS TEXT_LINE, 
         copied 
  FROM  (SELECT system, 
                `function`, 
                loglockmod, 
                extinfo, 
                primarykey, 
                foreignkey, 
                flgprimkey, 
                flgfrgnkey, 
                ref_recn, 
                text_line, 
                copied 
         FROM   phrase_longtext_orc_orc 
         WHERE  primarykey IS NOT NULL 
         GROUP  BY system, 
                   `function`, 
                   loglockmod, 
                   extinfo, 
                   primarykey, 
                   foreignkey, 
                   flgprimkey, 
                   flgfrgnkey, 
                   ref_recn, 
                   text_line, 
                   copied) t1
  GROUP  BY system, 
            `function`, 
            loglockmod, 
            extinfo, 
            primarykey, 
            foreignkey, 
            flgprimkey, 
            flgfrgnkey, 
            ref_recn, 
            text_line, 
            copied

相关问题