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

[CHORE] FunctionEvaluator directly receive FunctionExpr #2117

Merged
merged 1 commit into from
Apr 15, 2024

Conversation

MeepoWin
Copy link
Contributor

@MeepoWin MeepoWin commented Apr 14, 2024

It's sort of annoying to have to write the useless Expr::Function every time.

@@ -190,9 +190,7 @@ impl AggExpr {
))),
}
}
MapGroups { func, inputs } => {
func.to_field(inputs.as_slice(), schema, &Expr::Agg(self.clone()))
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The Expr::Agg here is actually useless: MapGroups only allow UDFs, and PythonUDF doesn't use the Expr passed in indeed.
If we really want the FunctionEvaluator to know if we're in an aggregation, an additional Context(Default/Agg) argument would make more sense I think.

Copy link
Member

Choose a reason for hiding this comment

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

Ah you're right! @colin-ho Was the rationale behind recreating the expression?

@MeepoWin MeepoWin marked this pull request as ready for review April 14, 2024 13:52
Copy link
Member

@samster25 samster25 left a comment

Choose a reason for hiding this comment

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

Great idea! Thanks for helping with this clean up!
Would love to brainstorm about the idea of passing in a agg context to the expression

@samster25 samster25 merged commit 69a1f5c into Eventual-Inc:main Apr 15, 2024
29 of 31 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants