gpt4 book ai didi

sql - 检查 Presto 中的映射或数组是否为空?

转载 作者:行者123 更新时间:2023-12-02 07:47:23 35 4
gpt4 key购买 nike

如何检查 Presto 中的 map 是否没有键?如果我有办法检查数组是否为空,我可以使用 map_keys 函数来确定 map 是否为空。

最佳答案

您可以使用基数函数:https://prestodb.io/docs/current/functions/array.html#cardinality

select cardinality(array[]) = 0;
_col0
-------
true
(1 row)

关于sql - 检查 Presto 中的映射或数组是否为空?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44192105/

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