gpt4 book ai didi

sql - 与 Hive SQL 合并

转载 作者:行者123 更新时间:2023-12-03 10:18:56 27 4
gpt4 key购买 nike

由于没有IFNULL , ISNULL , 或 NVL Hive 支持函数,我在将 NULL 转换为 0 时遇到问题。我试过 COALESCE(*column name*, 0)但收到以下错误消息:

Argument type mismatch 0: The expressions after COALESCE should all have the same type: "bigint" is expected but "int" is found



如何解决这个问题?

最佳答案

Hive 支持 bigint literal since 0.8 version .所以,额外的“L”就足够了:

COALESCE(column, 0L)

关于sql - 与 Hive SQL 合并,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13461424/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com