V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
leon0318
V2EX  ›  Java

非常蹊跷的 Hive 查询问题,求解答

  •  
  •   leon0318 · Oct 30, 2022 · 1742 views
    This topic created in 1288 days ago, the information mentioned may be changed or developed.
    select '{"${a}":"b"}';

    结果:
    {"":"b"}

    请问这是为啥呢?
    4 replies    2023-01-11 13:05:41 +08:00
    badboy17
        1
    badboy17  
       Oct 30, 2022   ❤️ 1
    a 没取到值,不就默认为空了吗
    leon0318
        2
    leon0318  
    OP
       Oct 31, 2022
    @badboy17 #1 请问 hive 中的${}是啥含义呢?有相关参考文档吗?
    xinxingi
        3
    xinxingi  
       Oct 31, 2022
    {"${a}":"b"} 这是我跑出来的结果
    Hive 版本为 2.1.1 你哪个版本的跑出来这个结果
    512357301
        4
    512357301  
       Jan 11, 2023 via Android
    @leonme 变量占位符,类似于 PHP 的$a
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1035 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 36ms · UTC 18:29 · PVG 02:29 · LAX 11:29 · JFK 14:29
    ♥ Do have faith in what you're doing.