gpt4 book ai didi

google-bigquery - 我如何使用新的 UDF 功能来创建 "Dynamic SQL statement"?

转载 作者:行者123 更新时间:2023-12-02 01:33:52 25 4
gpt4 key购买 nike

如何使用新的 UDF 功能来创建“动态 SQL 语句”?有没有办法使用 UDF 来构造基于模板和输入变量的 SQL 语句,然后运行此查询?

最佳答案

文档 https://cloud.google.com/bigquery/user-defined-functions?hl=en说:

A UDF is similar to the "Map" function in a MapReduce: it takes a single row as input and produces zero or more rows as output. The output can potentially have a different schema than the input.

因此您的 UDF 仅接收一行。因此 - 不,UDF 不适用于您在问题中描述的目的。

您可能会看一下 View - 也许这更适合您: https://cloud.google.com/bigquery/querying-data#views

关于google-bigquery - 我如何使用新的 UDF 功能来创建 "Dynamic SQL statement"?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32421890/

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