Skip to content

Remove input schema from PhysicalExpr, move the validation logic to physical expression planner - #6122

Merged
alamb merged 2 commits into
apache:mainfrom
mingmwang:physical_expr_input_schema
Apr 26, 2023
Merged

alamb merged 2 commits into
apache:mainfrom
mingmwang:physical_expr_input_schema

Conversation

@mingmwang

Copy link
Copy Markdown
Contributor

Which issue does this PR close?

Closes #6117.

Rationale for this change

FollowUp after #6114

What changes are included in this PR?

Are these changes tested?

Are there any user-facing changes?

@github-actions github-actions Bot added the physical-expr Changes to the physical-expr crates label Apr 26, 2023
@mingmwang
mingmwang requested a review from alamb April 26, 2023 05:59
@mingmwang

Copy link
Copy Markdown
Contributor Author

@crepererum

@crepererum crepererum left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is sooo much cleaner, thank you!

@alamb alamb changed the title Remove input schema from PhysicalExpr, move the validation logic to phyiscal expression planner Remove input schema from PhysicalExpr, move the validation logic to physical expression planner Apr 26, 2023

@alamb alamb left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This looks great to me -- thank you @mingmwang

cc @crepererum I think @mingmwang has fixed the root cause of the inlist discrepancy you fixed in #6114

Update: I didn't see @crepererum beat me to this review

lhs: Arc<dyn PhysicalExpr>,
op: Operator,
rhs: Arc<dyn PhysicalExpr>,
// TODO: move type checking to the planning phase and not in the physical expr

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🎉


/// Creates a `Box<dyn Set>` for the given list of `IN` expressions and `batch`
fn make_set(array: &dyn Array) -> Result<Box<dyn Set>> {
fn make_set(array: &dyn Array) -> Result<Arc<dyn Set>> {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is a clever idea -- to avoid cloning the set over and over again 👍

column.name(),
index,
))));
} else if let Some(in_list) = expr_any.downcast_ref::<InListExpr>() {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🎉

}

/// create a DateIntervalExpr
pub fn date_time_interval_expr(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

👍 this also follows the model of the other creation functions in physical expr.

};
pub use column::{col, Column, UnKnownColumn};
pub use datetime::DateTimeIntervalExpr;
pub use datetime::{date_time_interval_expr, DateTimeIntervalExpr};

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

👍

@alamb
alamb merged commit 569f6fe into apache:main Apr 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

physical-expr Changes to the physical-expr crates

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove input schema from PhysicalExpr, move the validation logic to phyiscal expression planner

3 participants