如何将输入从用户传递到雪花UDF中的Java脚本功能?
我必须将一些JS功能转换为雪花UDF。它可以成功地与硬编码的示例数据一起使用,但我无法接受用户输入作为参数。 我知道UDF的创建语句应该接受输入,但我无法使其起作用。
CREATE OR REPLACE FUNCTION findAndReplace()
RETURNS variant
LANGUAGE JAVASCRIPT
AS
$$
return execute(map,value);
$$
;
select findAndReplace();
感谢您的帮助。
I have to convert some JS functions to snowflake udfs. It works successfully with hardcoded sample data but I can't make it accept user input as arguments.
I know the UDF's create statement is supposed to take the input but I cannot make it work.
CREATE OR REPLACE FUNCTION findAndReplace()
RETURNS variant
LANGUAGE JAVASCRIPT
AS
$
return execute(map,value);
$
;
select findAndReplace();
Thanks for the help.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
假设要提供的参数在
map.set内部(“ sku”,“常见测量(l x w)^制造商颜色/饰面”);
必须将功能签名更改为findandreplace (arg1 text,arg2文本)
:功能全部:
Assuming that arguments to provide are inside
map.set("SKU","Common Measurement (L x W)^Manufacturer Color/Finish");
the function signature has to be changed tofindAndReplace(ARG1 TEXT, ARG2 TEXT)
:Function all: