【发布时间】:2017-04-05 10:28:17
【问题描述】:
今天我尝试在 Web 编辑器 UI 中使用标准 SQL 语言编写 UDF,并且我已经取消选中“使用旧版 SQL”选项,但它返回给我以下错误消息: 未实现:您不能将旧版 SQL UDF 与标准 SQL 查询一起使用。见https://cloud.google.com/bigquery/docs/reference/standard-sql/migrating-from-legacy-sql#differences_in_user-defined_javascript_functions
因此我尝试了 Google Cloud Platform 上提供的外部 UDF 示例:https://cloud.google.com/bigquery/docs/reference/standard-sql/user-defined-functions。但它仍然返回给我同样的错误信息。在下面的例子中:
CREATE TEMPORARY FUNCTION multiplyInputs(x FLOAT64, y FLOAT64)
RETURNS FLOAT64
LANGUAGE js AS """
return x*y;
""";
WITH numbers AS
(SELECT 1 AS x, 5 as y
UNION ALL
SELECT 2 AS x, 10 as y
UNION ALL
SELECT 3 as x, 15 as y)
SELECT x, y, multiplyInputs(x, y) as product
FROM numbers;
问题:如何在 Web UI 中将外部 UDF 与标准 SQL 一起使用?
【问题讨论】:
标签: google-bigquery google-cloud-platform