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

Minor Fix for Logical and Physical Expr Conversions #11142

Merged
merged 2 commits into from
Jun 27, 2024

Conversation

berkaysynnada
Copy link
Contributor

@berkaysynnada berkaysynnada commented Jun 27, 2024

Which issue does this PR close?

Closes #.

Rationale for this change

This is just a minor clean-up PR, locating logical2physical() where other physical expressions are created. I have also added a notice for the recently added API.

What changes are included in this PR?

Removes some duplications of a function and add a notice for with_new_expressions() API.

Are these changes tested?

Are there any user-facing changes?

@github-actions github-actions bot added physical-expr Physical Expressions core Core DataFusion crate labels Jun 27, 2024
@berkaysynnada berkaysynnada reopened this Jun 27, 2024
Copy link
Contributor

@ozankabak ozankabak left a comment

Choose a reason for hiding this comment

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

TY, LGTM

Copy link
Contributor

@alamb alamb left a comment

Choose a reason for hiding this comment

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

Looks like a nice cleanup to me -- thank you @berkaysynnada

@@ -867,13 +868,6 @@ mod test {
LiteralGuarantee::try_new(column, Guarantee::NotIn, literals.iter()).unwrap()
}

/// Convert a logical expression to a physical expression (without any simplification, etc)
fn logical2physical(expr: &Expr, schema: &Schema) -> Arc<dyn PhysicalExpr> {
Copy link
Contributor

Choose a reason for hiding this comment

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

I was going to suggest using SessonState::create_physical_expr or SessionContext::create_physical_expr but I think that those are not available to code in the physical-expr crate

let physical_expr = SessionContext::new().create_physical_expr(expr, &df_schema)?;

@alamb alamb merged commit 0c4e4a1 into apache:main Jun 27, 2024
24 of 46 checks passed
findepi pushed a commit to findepi/datafusion that referenced this pull request Jul 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Core DataFusion crate physical-expr Physical Expressions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants