Python UDF for dozer #870
Replies: 4 comments 8 replies
-
I prefer approach 2, but not exactly sure how it works. Problem with approach 1:
Question about approach 2:
|
Beta Was this translation helpful? Give feedback.
-
I also like approach 2. |
Beta Was this translation helpful? Give feedback.
-
I also prefer approach 2 - but agree on we need more than just a user provided function, and managing python env - maybe hygeia + pyo3 might work |
Beta Was this translation helpful? Give feedback.
-
In fact, I also like approach 2 🤣. So let's do more detailed design by approach 2, thanks, guys! |
Beta Was this translation helpful? Give feedback.
-
The General UDF Process
create xxx
, function-related information will be stored in metadata.select func_name...
, the parser detects the function, and the SQL layer should first determine whether the function is already supported by Dozer. If not, query the UDF in metadata.func as a → a + 3
, then the UDF will be processed intoselect a + 3…;
Dozer Python UDF
Approach One
create udf func..
).Example code
Approach Two
create udf function with Python code
, and UDF-related information is stored in the meta, such as: function name, UDF function code.Comparison
2. No need to support create udf/delete udf or similar syntax.
- parse python file line by line and convert to middle layer, too complicated, corner cases too much.
- leverage some codegen crate.
2. Able to handle various corner cases.
2. Require support for more SQL syntax.
Happy to receive any feedback!
Beta Was this translation helpful? Give feedback.
All reactions