According to this confluence page:
https://cwiki.apache.org/confluence/display/FLINK/FLIP-106%3A+Support+Python+UDF+in+SQL+Function+DDL
python udf are in Flink 1.11 available to be used with in SQL functions.
I went to the flink docs here:
https://ci.apache.org/projects/flink/flink-docs-stable/dev/table/sqlClient.html
and try this on the terminal and launch the sql-client.sh with the following parameters:
$ sql-client.sh embedded --pyExecutable /Users/jonathanfigueroa/opt/anaconda3/bin/python --pyFiles /Users/jonathanfigueroa/Desktop/pyflink/inference/test1.py
and then:
> Create Temporary System Function func1 as 'test1.func1' Language PYTHON;
[INFO] Function has been created.
and when i tried:
> Select func1(str) From (VALUES ("Name1", "Name2", "Name3"));
[ERROR] Could not execute SQL statement. Reason:
java.lang.IllegalStateException: Instantiating python function 'test1.func1' failed.
I have tried to use: -pyarch,--pyArchives, -pyexec,--pyExecutable, -pyfs,--pyFiles
in every single combination .zip, .py
and allways the same result.
btw my python file looks like this:
def func1(s):
return s;
Is there anything I'm missing?
Kind Regards,
Jonathan