我尝试在 google BigQuery api 上运行查询并得到如下异常:
“函数 IF 中的参数类型不匹配:‘distinctPlayers’的类型为‘TYPE_UINT64’,‘0’的类型为‘TYPE_INT32’。”
查询太大,所以我只写了失败的部分。
查询:sum(if(action_type == 3,distinctPlayers,0))作为Game_Viral_Acceptor_Count
我的理解是:
if condition is true
then set distinctPlayers of type unsigned int64
otherwise set 0 which is of type int32
任何人都可以阐明如何转换unsigned int64
to signed int
通过BigQuery
.
提前致谢,
奥姆卡
要回答你的问题,你投射到signed int 的方式是通过INTEGER
功能。所以你应该能够成功运行
... SUM(IF(action_type == 3, INTEGER(distinctPlayers), 0)) AS ...
然而,您看到的消息实际上指向 BigQuery 中的一个错误 - 我现在正在内部提交该错误。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)