V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
thankyourtender
V2EX  ›  问与答

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

  •  
  •   thankyourtender · 2014-10-13 16:34:15 +08:00 · 3220 次点击
    这是一个创建于 3489 天前的主题,其中的信息可能已经有所发展或是发生改变。
    select xxx from
    (
    select xxx from
    union all
    select xxx from
    )t
    这个 子查询不允许加括号 我就不知道 是怎么检测语法的?
    3 条回复    2014-10-14 11:00:19 +08:00
    thankyourtender
        1
    thankyourtender  
    OP
       2014-10-13 16:34:23 +08:00
    MySQL里面是可以的
    crazybubble
        2
    crazybubble  
       2014-10-14 10:34:33 +08:00
    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
       2014-10-14 11:00:19 +08:00
    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".
    看到了,有限制
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1791 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 00:42 · PVG 08:42 · LAX 17:42 · JFK 20:42
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.