I want to use SQL query in udf and get some column value from it and have some calculation through it. I am not able to write SQL inside permanent udf function. I want something like that ->
create function dataset.fun(j int64)
language js as r"""
select a from dataset.table1 where condition;
#let's suppose column "a" is int64
return (j+a)
"""
How to correct it? What is the correct way to write this UDF function?
And if it is not possible through js, Kindly suggest me the other way.
Thank you in advance.