Skip to content

Conversation

@charlesbluca
Copy link

Which issue does this PR close?

Related to #2175 and #3807.

Rationale for this change

Continuing the work outlined in #3807 to bring Expr variants more in line with LogicalPlan variants.

What changes are included in this PR?

Refactors Expr::GetIndexedField to use a struct.

Are there any user-facing changes?

No

}
}

#[derive(Clone, PartialEq, Eq, Hash)]
Copy link
Author

Choose a reason for hiding this comment

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

Overlooked it because I wasn't sure what expression GetIndexedField corresponds to, but should add a comment here explaining the purpose of this struct

@charlesbluca charlesbluca changed the title Get indexed field struct Refactor Expr::GetIndexedField to use a struct Oct 17, 2022
@github-actions github-actions bot added core Core DataFusion crate logical-expr Logical plan and expressions optimizer Optimizer rules physical-expr Changes to the physical-expr crates sql SQL Planner labels Oct 17, 2022
Copy link
Member

@andygrove andygrove left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks @charlesbluca

}

#[derive(Clone, PartialEq, Eq, Hash)]
pub struct GetIndexedField {
Copy link
Member

Choose a reason for hiding this comment

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

I think we can just re-use the docs from the Expr::GetIndexField enum variant here:

Suggested change
pub struct GetIndexedField {
/// Returns the field of a [`arrow::array::ListArray`] or [`arrow::array::StructArray`] by key
pub struct GetIndexedField {

@andygrove
Copy link
Member

There is another PR open for the same work - #3838

@alamb
Copy link
Contributor

alamb commented Oct 18, 2022

This appears to have been done in #3838 -- sorry I didn't see this PR prior to merging #3838

@charlesbluca
Copy link
Author

Ah my bad completely missed that, happy to close in that case

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 optimizer Optimizer rules physical-expr Changes to the physical-expr crates sql SQL Planner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants