Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angular/27.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Sql 通过google BigQuery将无符号整数转换为有符号整数_Sql_Int_Google Bigquery_Uint - Fatal编程技术网

Sql 通过google BigQuery将无符号整数转换为有符号整数

Sql 通过google BigQuery将无符号整数转换为有符号整数,sql,int,google-bigquery,uint,Sql,Int,Google Bigquery,Uint,我尝试在google BigQuery api上运行查询,但出现如下异常: 如果“distinctPlayers”的类型为“type\u UINT64”,“0”的类型为“type\u INT32”,则函数中的参数类型不匹配 这个查询太大了,所以我只写了部分失败的地方 查询:和(如果(action\u type==3,distinctPlayers,0))作为游戏\u病毒\u接收器\u计数 我的理解是: if condition is true then set distinctPlayers

我尝试在google BigQuery api上运行查询,但出现如下异常:

如果“distinctPlayers”的类型为“type\u UINT64”,“0”的类型为“type\u INT32”,则函数中的参数类型不匹配

这个查询太大了,所以我只写了部分失败的地方

查询:和(如果(action\u type==3,distinctPlayers,0))作为游戏\u病毒\u接收器\u计数

我的理解是:

if condition is true 
then set distinctPlayers of type unsigned int64 
otherwise set 0 which is of type int32
有谁能告诉我们如何通过
BigQuery
unsigned int64
转换为
signed int

提前感谢,,
Omkar

要回答您的问题,您转换为有符号整数的方式是通过
整数
函数。因此,您应该能够成功运行

... SUM(IF(action_type == 3, INTEGER(distinctPlayers), 0)) AS ...

然而,您看到的消息实际上指向了BigQuery中的一个bug——我现在正在内部归档该bug。

看起来bug仍然存在,我今天也遇到了同样的错误。我必须这样做才能让它工作:整数(count(distinct myField,10000))