Closed zhuzhuyan93 closed 8 months ago
Decorator for chDB Python UDF(User Defined Function).
The function will be called for each line of input. Something like this:
def sum_udf(lhs, rhs):
return int(lhs) + int(rhs)
for line in sys.stdin:
args = line.strip().split('\t')
lhs = args[0]
rhs = args[1]
print(sum_udf(lhs, rhs))
sys.stdout.flush()
def func_use_json(arg):
import json
...
sys.executable
when i generate the code:
i got
Code: 1. DB::Exception: Function 'similarity': wrong result, expected 8 row(s), actual 0: while executing 'FUNCTION similarity(vec :: 0, vec2 :: 1) -> similarity(vec, vec2) String : 2'. (UNSUPPORTED_METHOD)
in which UDF defined as: