Snowflake UDF给出了错误 - 无法评估不支持的子查询类型
我在对UDF上进行选择时会遇到此错误 - “无法评估不支持的子查询类型”,UDF的参数来自加入,但不确定这里出了什么问题。我已经尝试了所有建议,但是它不起作用,
它是SQL UDF-返回varchar。
任何帮助将不胜感激
I am getting this error on doing a select on UDF - "Unsupported subquery type cannot be evaluated", the parameters of the UDF are coming from the joins but not sure what is going wrong here. I have tried every suggestions but it is not working
It is SQL UDF - returning a varchar.
Any help will be appreciated
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果SQL UDF本身运行良好。那么,将发生的事情是将其组合到主查询中后,您就有一个不支持的相关子查询。
如果您在UDF中具有“很棒的复杂魔术”,请将其更改为UDTF,并返回所有行ABD的结果,然后加入。这是雪花中的最佳连接图案。又名而不是逐行查找。构建尽可能完整的数据表并将其加在一起的表。
If the SQL UDF runs fine by itself. Then what will be happening is once you compose it into you main query you have forms a correlated sub-query that is not supported.
If you have “awesome complex magic” in the udf, change it be a udtf and return those results for all rows abd then join to that. This is the optimal join pattern in snowflake. Aka instead of row-by-row lookups. Build tables of as complete as possible data and join those together.
标量UDF返回VARCHAR也有类似的问题。我通过在Select语句中使用Max(“字符串字段或表达式”)解决了它。
I also had a similar problem with a scalar UDF returning varchar. I solved it by using MAX('string field or expression') in the select statement.