2017-08-01 14 views
2

私はstandart SQLでbigqueryを使用しています。関数intフィールドに渡すと、この関数は文字列に変換します。ここでBigQueryテンポラリ関数はintを文字列に変換します

はコードです:ここでは

CREATE TEMPORARY FUNCTION test_function(int_field INT64) RETURNS INT64 

LANGUAGE js AS """ 
throw typeof(int_field) 
//return int_field 
"""; 

WITH 

test_table as (SELECT 1 as int_field) 

SELECT test_function(int_field) from test_table 

はエラーである:ここではstring at test_function(INT64) line 2, column 1

はジョブIDです:fabrika-okon:bquijob_2cb8c50e_15d9db59b4f

答えて

3

As JavaScript does not support a 64-bit integer type, INT64 is unsupported in input or output types for JavaScript UDFs. Instead, use FLOAT64 to represent integer values as a number, or STRING to represent integer values as a string.

SQL type encodings in JavaScript

でより多くを参照してください。
関連する問題