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: Implement serde for join filter #2649

Merged
merged 1 commit into from
May 30, 2022

Conversation

andygrove
Copy link
Member

Which issue does this PR close?

N/A

Rationale for this change

Ballista had this change in its copy of serde and Ballista now delegates to datafusion-proto for logical plan serde so we need this change here.

What changes are included in this PR?

Add JoinNode::filter

Are there any user-facing changes?

No

Does this PR break compatibility with Ballista?

No

@andygrove andygrove self-assigned this May 29, 2022
@github-actions github-actions bot added the datafusion Changes in the datafusion crate label May 29, 2022
@andygrove andygrove marked this pull request as ready for review May 29, 2022 16:44
@andygrove
Copy link
Member Author

@korowa fyi

Copy link
Contributor

@tustvold tustvold left a comment

Choose a reason for hiding this comment

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

LGTM, I think you can use transpose to make the code easier to follow

.filter
.as_ref()
.map(|expr| parse_expr(expr, ctx))
.map_or(Ok(None), |v| v.map(Some))?;
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe https://doc.rust-lang.org/std/option/enum.Option.html#method.transpose ? I'm having a hard time figuring out what the types are though so could be mistaken

Copy link
Contributor

@korowa korowa May 30, 2022

Choose a reason for hiding this comment

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

Transpose seems to be appropriate -- I used this map_or call in ballista for conversion from Option<Result> to Result<Option>

Copy link
Member Author

Choose a reason for hiding this comment

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

I copied the code over from Ballista and am not too familiar with what is going on here. @korowa would you mind updating this in a follow on PR?

Copy link
Contributor

Choose a reason for hiding this comment

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

NP 👌

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.

One copy of serialization for the win! Thank you @andygrove

@andygrove andygrove merged commit e5ae1ea into apache:master May 30, 2022
@andygrove andygrove deleted the proto-join-filter branch May 30, 2022 15:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
datafusion Changes in the datafusion crate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants