You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/05/29 16:44:31 UTC

[GitHub] [arrow-datafusion] andygrove opened a new pull request, #2649: MINOR: Implement serde for join filter

andygrove opened a new pull request, #2649:
URL: https://github.com/apache/arrow-datafusion/pull/2649

   # Which issue does this PR close?
   
   <!--
   We generally require a GitHub issue to be filed for all bug fixes and enhancements and this helps us generate change logs for our releases. You can link an issue to this PR using the GitHub syntax. For example `Closes #123` indicates that this PR will close issue #123.
   -->
   
   N/A
   
    # Rationale for this change
   <!--
    Why are you proposing this change? If this is already explained clearly in the issue then this section is not needed.
    Explaining clearly why changes are proposed helps reviewers understand your changes and offer better suggestions for fixes.  
   -->
   
   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?
   <!--
   There is no need to duplicate the description in the issue here but it is sometimes worth providing a summary of the individual changes in this PR.
   -->
   
   Add JoinNode::filter
   
   # Are there any user-facing changes?
   <!--
   If there are user-facing changes then we may require documentation to be updated before approving the PR.
   -->
   
   No
   
   <!--
   If there are any breaking changes to public APIs, please add the `api change` label.
   -->
   
   # Does this PR break compatibility with Ballista?
   
   No
   
   <!--
   The CI checks will attempt to build [arrow-ballista](https://github.com/apache/arrow-ballista) against this PR. If 
   this check fails then it indicates that this PR makes a breaking change to the DataFusion API.
   
   If possible, try to make the change in a way that is not a breaking API change. For example, if code has moved 
    around, try adding `pub use` from the original location to preserve the current API.
   
   If it is not possible to avoid a breaking change (such as when adding enum variants) then follow this process:
   
   - Make a corresponding PR against `arrow-ballista` with the changes required there
   - Update `dev/build-arrow-ballista.sh` to clone the appropriate `arrow-ballista` repo & branch
   - Merge this PR when CI passes
   - Merge the Ballista PR
   - Create a new PR here to reset `dev/build-arrow-ballista.sh` to point to `arrow-ballista` master again
   
   _If you would like to help improve this process, please see https://github.com/apache/arrow-datafusion/issues/2583_
   -->


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-datafusion] andygrove commented on pull request #2649: MINOR: Implement serde for join filter

Posted by GitBox <gi...@apache.org>.
andygrove commented on PR #2649:
URL: https://github.com/apache/arrow-datafusion/pull/2649#issuecomment-1140494668

   @korowa fyi


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-datafusion] korowa commented on a diff in pull request #2649: MINOR: Implement serde for join filter

Posted by GitBox <gi...@apache.org>.
korowa commented on code in PR #2649:
URL: https://github.com/apache/arrow-datafusion/pull/2649#discussion_r884440270


##########
datafusion/proto/src/logical_plan.rs:
##########
@@ -605,6 +605,11 @@ impl AsLogicalPlan for LogicalPlanNode {
                         join.join_constraint
                     ))
                 })?;
+                let filter: Option<Expr> = join
+                    .filter
+                    .as_ref()
+                    .map(|expr| parse_expr(expr, ctx))
+                    .map_or(Ok(None), |v| v.map(Some))?;

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



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-datafusion] andygrove merged pull request #2649: MINOR: Implement serde for join filter

Posted by GitBox <gi...@apache.org>.
andygrove merged PR #2649:
URL: https://github.com/apache/arrow-datafusion/pull/2649


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-datafusion] korowa commented on a diff in pull request #2649: MINOR: Implement serde for join filter

Posted by GitBox <gi...@apache.org>.
korowa commented on code in PR #2649:
URL: https://github.com/apache/arrow-datafusion/pull/2649#discussion_r884440270


##########
datafusion/proto/src/logical_plan.rs:
##########
@@ -605,6 +605,11 @@ impl AsLogicalPlan for LogicalPlanNode {
                         join.join_constraint
                     ))
                 })?;
+                let filter: Option<Expr> = join
+                    .filter
+                    .as_ref()
+                    .map(|expr| parse_expr(expr, ctx))
+                    .map_or(Ok(None), |v| v.map(Some))?;

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



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-datafusion] korowa commented on a diff in pull request #2649: MINOR: Implement serde for join filter

Posted by GitBox <gi...@apache.org>.
korowa commented on code in PR #2649:
URL: https://github.com/apache/arrow-datafusion/pull/2649#discussion_r884924361


##########
datafusion/proto/src/logical_plan.rs:
##########
@@ -605,6 +605,11 @@ impl AsLogicalPlan for LogicalPlanNode {
                         join.join_constraint
                     ))
                 })?;
+                let filter: Option<Expr> = join
+                    .filter
+                    .as_ref()
+                    .map(|expr| parse_expr(expr, ctx))
+                    .map_or(Ok(None), |v| v.map(Some))?;

Review Comment:
   NP 👌 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-datafusion] tustvold commented on a diff in pull request #2649: MINOR: Implement serde for join filter

Posted by GitBox <gi...@apache.org>.
tustvold commented on code in PR #2649:
URL: https://github.com/apache/arrow-datafusion/pull/2649#discussion_r884339816


##########
datafusion/proto/src/logical_plan.rs:
##########
@@ -605,6 +605,11 @@ impl AsLogicalPlan for LogicalPlanNode {
                         join.join_constraint
                     ))
                 })?;
+                let filter: Option<Expr> = join
+                    .filter
+                    .as_ref()
+                    .map(|expr| parse_expr(expr, ctx))
+                    .map_or(Ok(None), |v| v.map(Some))?;

Review Comment:
   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



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-datafusion] andygrove commented on a diff in pull request #2649: MINOR: Implement serde for join filter

Posted by GitBox <gi...@apache.org>.
andygrove commented on code in PR #2649:
URL: https://github.com/apache/arrow-datafusion/pull/2649#discussion_r884921884


##########
datafusion/proto/src/logical_plan.rs:
##########
@@ -605,6 +605,11 @@ impl AsLogicalPlan for LogicalPlanNode {
                         join.join_constraint
                     ))
                 })?;
+                let filter: Option<Expr> = join
+                    .filter
+                    .as_ref()
+                    .map(|expr| parse_expr(expr, ctx))
+                    .map_or(Ok(None), |v| v.map(Some))?;

Review Comment:
   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?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org