thankyourtender
V2EX  ›  问与答

HIVE 这个 子查询不允许加括号 我就不知道 是怎么检测语法的?

  •  
  •   thankyourtender · Oct 13, 2014 · 3826 views
    This topic created in 4282 days ago, the information mentioned may be changed or developed.
    select xxx from
    (
    select xxx from
    union all
    select xxx from
    )t
    这个 子查询不允许加括号 我就不知道 是怎么检测语法的?
    3 replies    2014-10-14 11:00:19 +08:00
    thankyourtender
        1
    thankyourtender  
    OP
       Oct 13, 2014
    MySQL里面是可以的
    crazybubble
        2
    crazybubble  
       Oct 14, 2014
    https://cwiki.apache.org/confluence/display/Hive/LanguageManual+SubQueries
    https://cwiki.apache.org/confluence/display/Hive/LanguageManual+Union
    看上去是可以的阿,是不是你的union all那块写错了?或者unionResult那里写错了?还有版本也是个坑,看看你用的版本对这两个操作有哪些限制不
    thankyourtender
        3
    thankyourtender  
    OP
       Oct 14, 2014
    In Hive 0.12.0 and earlier releases, unions can only be used within a subquery such as "SELECT * FROM (select_statement UNION ALL select_statement UNION ALL ...) unionResult".
    看到了,有限制
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2786 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 30ms · UTC 15:02 · PVG 23:02 · LAX 08:02 · JFK 11:02
    ♥ Do have faith in what you're doing.