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

Implement UDF Plan #11263

Closed
wants to merge 7 commits into from
Closed

Conversation

xinlifoobar
Copy link
Contributor

@xinlifoobar xinlifoobar commented Jul 4, 2024

Which issue does this PR close?

Closes #11242 and part of #11207

Rationale for this change

What changes are included in this PR?

Are these changes tested?

Are there any user-facing changes?

@xinlifoobar xinlifoobar marked this pull request as draft July 4, 2024 09:45
@github-actions github-actions bot added sql SQL Planner logical-expr Logical plan and expressions core Core DataFusion crate labels Jul 4, 2024
@xinlifoobar xinlifoobar changed the title [Draft] Implement Plan UDF Implement UDF Plan Jul 5, 2024
@xinlifoobar xinlifoobar marked this pull request as ready for review July 5, 2024 13:04
Copy link
Contributor

@jayzhan211 jayzhan211 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO I don't think this is a good abstration, because extract and position are actually quite different concept. For the point of view to user-defined planner, they could have their own implementation that may not be UDF, so it does not make sense to place them to plan_udf for me.

I would prefer to have plan_extract and plan_position separately.

Btw, I suggest using plan_udaf in #11229, as we are customizing the query of aggregate function. Similarly, I think here should be the correct place for plan_udf

@xinlifoobar What do you think?

planner_context: &mut PlannerContext,
) -> Result<Expr> {
let sql_not_moved = sql.clone();
let mut extracted_args = match sql {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it seems not to be extract specific anymore, we could name it args

@alamb
Copy link
Contributor

alamb commented Jul 5, 2024

I would prefer to have plan_extract and plan_position separately.

Here is a PR for planning position: #11243

It isn't clear to me what we should do with this PR now (should we close it?)

@alamb
Copy link
Contributor

alamb commented Jul 5, 2024

IMO I don't think this is a good abstration, because extract and position are actually quite different concept. For the point of view to user-defined planner, they could have their own implementation that may not be UDF, so it does not make sense to place them to plan_udf for me.

I would prefer to have plan_extract and plan_position separately.

I agree that even though the functions are somewhat repetitively named, it is better to be explicit in the function names rather than being implicit (via function name) as the API proposed in this PR would be

Sorry I didn't see the comments on #11207 (comment) on #11207 earlier

@jayzhan211
Copy link
Contributor

I would prefer to have plan_extract and plan_position separately.

Here is a PR for planning position: #11243

It isn't clear to me what we should do with this PR now (should we close it?)

I think we can close #11263(?) And proceed #11243

This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Core DataFusion crate logical-expr Logical plan and expressions sql SQL Planner
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement user defined planner for sql_position_to_expr
4 participants