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/03/07 16:24:16 UTC

[GitHub] [arrow-datafusion] thinkharderdev opened a new pull request #1941: Pruning serialization

thinkharderdev opened a new pull request #1941:
URL: https://github.com/apache/arrow-datafusion/pull/1941


   # 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.
   -->
   
   Closes #.
   
    # 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.  
   -->
   
   Currently, we don't preserve pruning predicates in `ParquetExec` when serializing for Ballista. This was probably the case because the `PruningPredicate` requires the original logical `Expr` to reconstruct. This PR preserves the original `Expr` in `PruningPredicate` so we can serialize it. 
   
   # 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.
   -->
   
   1. Preserve the original logical `Expr` in the `PruningPredicate` struct.2. 
   2. Serialize the pruning `Expr` in the protobuf message which encodes the `ParquetExec` 
   3. Reconstruct the `PruninPredicate` when deserializing the `ParquetExec`. 
   # 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.
   -->
   
   No


-- 
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] thinkharderdev commented on a change in pull request #1941: Pruning serialization

Posted by GitBox <gi...@apache.org>.
thinkharderdev commented on a change in pull request #1941:
URL: https://github.com/apache/arrow-datafusion/pull/1941#discussion_r821226873



##########
File path: datafusion/src/physical_optimizer/pruning.rs
##########
@@ -143,6 +145,7 @@ impl PruningPredicate {
             schema,
             predicate_expr,
             required_columns,
+            logical_expr: expr.clone(),

Review comment:
       Makes sense. I should have some time tomorrow to see if I can do this relatively easily. If it turns out to be more involved then we can create a follow up task for it. 




-- 
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] alamb commented on pull request #1941: Pruning serialization

Posted by GitBox <gi...@apache.org>.
alamb commented on pull request #1941:
URL: https://github.com/apache/arrow-datafusion/pull/1941#issuecomment-1062001926


   This PR seems to have a logical conflict with https://github.com/apache/arrow-datafusion/pull/1887 -- I am working to fix that


-- 
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] alamb commented on pull request #1941: Pruning serialization

Posted by GitBox <gi...@apache.org>.
alamb commented on pull request #1941:
URL: https://github.com/apache/arrow-datafusion/pull/1941#issuecomment-1062008373


   Fix in https://github.com/apache/arrow-datafusion/pull/1958


-- 
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] alamb commented on a change in pull request #1941: Pruning serialization

Posted by GitBox <gi...@apache.org>.
alamb commented on a change in pull request #1941:
URL: https://github.com/apache/arrow-datafusion/pull/1941#discussion_r821123794



##########
File path: datafusion/src/physical_optimizer/pruning.rs
##########
@@ -143,6 +145,7 @@ impl PruningPredicate {
             schema,
             predicate_expr,
             required_columns,
+            logical_expr: expr.clone(),

Review comment:
       It might be worth considering changing the signature of this function from `
   
   ```rust
   pub fn try_new(expr: &Expr, schema: SchemaRef) -> Result<Self> {
   ``` 
   
   to take the Expr directly rather than `clone` within 
   
   ```rust
   pub fn try_new(expr: Expr, schema: SchemaRef) -> Result<Self> {
   ```
   
   The rationale would be if the caller already has a `Expr` they could pass it in rather than forcing a copy. 




-- 
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] alamb merged pull request #1941: Pruning serialization

Posted by GitBox <gi...@apache.org>.
alamb merged pull request #1941:
URL: https://github.com/apache/arrow-datafusion/pull/1941


   


-- 
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] alamb commented on a change in pull request #1941: Pruning serialization

Posted by GitBox <gi...@apache.org>.
alamb commented on a change in pull request #1941:
URL: https://github.com/apache/arrow-datafusion/pull/1941#discussion_r821846999



##########
File path: datafusion/src/physical_optimizer/pruning.rs
##########
@@ -143,6 +145,7 @@ impl PruningPredicate {
             schema,
             predicate_expr,
             required_columns,
+            logical_expr: expr.clone(),

Review comment:
       Thanks @thinkharderdev  -- to keep the code flowing I am going to merge this PR as is and we can do the cleanup in a follow on PR. Let me know if you don't get a chance and I can file a follow on ticket to do so




-- 
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] alamb commented on a change in pull request #1941: Pruning serialization

Posted by GitBox <gi...@apache.org>.
alamb commented on a change in pull request #1941:
URL: https://github.com/apache/arrow-datafusion/pull/1941#discussion_r821124115



##########
File path: datafusion/src/physical_optimizer/pruning.rs
##########
@@ -143,6 +145,7 @@ impl PruningPredicate {
             schema,
             predicate_expr,
             required_columns,
+            logical_expr: expr.clone(),

Review comment:
       We could always do that as a follow on PR as well




-- 
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