Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Python UDF #46248

Open
3 tasks done
stdpain opened this issue May 24, 2024 · 4 comments · Fixed by #46247, #46299 or #46449
Open
3 tasks done

Support Python UDF #46248

stdpain opened this issue May 24, 2024 · 4 comments · Fixed by #46247, #46299 or #46449

Comments

@stdpain
Copy link
Contributor

stdpain commented May 24, 2024

Feature request

support Python UDF for starrocks

grammar: extends the create function to support inline call

CREATE FUNCTION echo(int) 
RETURNS int 
properties(     
"symbol" = "add", 
"type" = "Python",     
"file" = "inline" ,
"input" = "arrow"
)  
AS
$$
def echo(a):
    return a;
$$;

UDFCall:
use grpc to call Python UDF
Be process

Python Env Support:
Since 3.8+ Arrow 16.0.0+
grpc

pip install pyarrow
pip install grpcio

make sure all package are install in PYTHONHOME (config in BE)

fe config:
enable_udf=true
be config:

python_envs=/root/python38

examples:

see test/sql/test_udf/test_python_udf

Additional context

PR Links

@dirtysalt
Copy link
Contributor

dirtysalt commented May 24, 2024

@WencongLiu
Copy link

@stdpain Hi, recently, I have been researching how to implement Python UDAF and UDTF. Can we add a WeChat conversation? Also, do you have any specific design documentation for your Python UDF?
My WeChat is Liuwenclever.😆

@stdpain
Copy link
Contributor Author

stdpain commented Sep 27, 2024

@stdpain Hi, recently, I have been researching how to implement Python UDAF and UDTF. Can we add a WeChat conversation? Also, do you have any specific design documentation for your Python UDF? My WeChat is Liuwenclever.😆

We could open a public discussion in slack. https://starrocks.slack.com/archives/C02FAD0JSSD

@zhangm365
Copy link
Contributor

@stdpain Hi,
I have heard the python UDF will be supported in version 3.4, so when is the expected time?
Thanks a lot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment