-
Notifications
You must be signed in to change notification settings - Fork 849
feat: Sandbox UDF #19301
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
base: main
Are you sure you want to change the base?
feat: Sandbox UDF #19301
Conversation
🤖 CI Job Analysis
📊 Summary
❌ NO RETRY NEEDEDAll failures appear to be code/test issues requiring manual fixes. 🔍 Job Details
🤖 AboutAutomated analysis using job annotations to distinguish infrastructure issues (auto-retried) from code/test issues (manual fixes needed). |
…regardless of whether cloud is enabled.
221f0f3 to
8a495ef
Compare
|
|
||
| package udfproto; | ||
|
|
||
| message UdfImport { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
UdfAsset
|
|
||
| message ApplyUdfResourceRequest { | ||
| // JSON runtime spec (code/handler/types/packages). Control plane builds Dockerfile. | ||
| string spec = 1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why embed JSON in protobuf?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Following this method ‘build_udf_cloud_spec’, pass the spec to the mock server so that it controls the specific construction of the Dockerfile.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why JSON? Protobuf itself has a lot of compatibility designs, there is no need to use embedded JSON
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Docker specs are usually constructed in JSON to represent nested parameters, which makes structural adjustments convenient. Using Protobuf to pass nested structures is relatively more cumbersome. Does @everpcpc think using Protobuf would be a better choice?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think if the structure is relatively fixed and won’t change much, I would prefer to use Protobuf. Although JSON is more flexible for handling nesting and structural adjustments, Protobuf’s strong type definitions are clearer to work with for stable structures.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In fact, for adjusting the structure of how to parse the json, the specification is completely undefined, everything depends on the implementation, there may be subtle differences in each library, json there are some details of the issue of creating countless bugs, for example, [] can be represented by null is a typical example.
pb, on the other hand, is much more explicit in how it handles this, as it is written in the specification.
I hereby agree to the terms of the CLA available at: https://docs.databend.com/dev/policies/cla/
Summary
Databend’s Python UDFs are currently implemented via in-process calls using PyO3, which introduces several key limitations:
This PR introduces support for remotely and dynamically executing Python UDFs in Databend, organized into three layers:
Workflow
Config
Query to configure the startup of Cloud Python UDF
Set the expiration time of the presigned URL in the session.
Tests
Type of change
This change is