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/11/14 22:02:27 UTC

[GitHub] [arrow-datafusion] andygrove opened a new pull request, #4208: Add try_optimize method

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

   # 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.  
   -->
   
   This PR aims to improve the API for optimizer rules by adding a new `try_optimize` method that returns `Result<Option<LogicalPlan>>` so that rules can now choose to return `Ok(None)` if the rule is not applicable to the plan.
   
   # 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.
   -->
   
   # Are these changes tested?
   
   <!--
   We typically require tests for all PRs in order to:
   1. Prevent the code from being accidentally broken by subsequent changes
   2. Serve as another way to document the expected behavior of the code
   
   If tests are not included in your PR, please explain why (for example, are they covered by existing tests)?
   -->
   
   # Are there any user-facing changes?
   
   <!--
   If there are user-facing changes then we may require documentation to be updated before approving the PR.
   -->
   
   <!--
   If there are any breaking changes to public APIs, please add the `api change` label.
   -->


-- 
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] HaoYang670 commented on pull request #4208: Add try_optimize method

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

   > Add try_optimize method to Optimizer trait with a default implementation that calls the existing optimize method for backwards compatibility
   
   Will we remove the existing `optimize` function in the future?


-- 
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 #4208: Add try_optimize method

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


-- 
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 #4208: Add try_optimize method

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

   > in my opinion, It depends on can we refactor all rule, when we do all job, we can remove.
   
   Yes, exactly. This way we can update one rule at a time, and remove it when we are done.


-- 
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] ursabot commented on pull request #4208: Add try_optimize method

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

   Benchmark runs are scheduled for baseline = 4653df4652c8af5d4e8841c489c1ab2e85a54e69 and contender = 28ca3eeac437994be836d299748d3fb3e0ed8b04. 28ca3eeac437994be836d299748d3fb3e0ed8b04 is a master commit associated with this PR. Results will be available as each benchmark for each run completes.
   Conbench compare runs links:
   [Skipped :warning: Benchmarking of arrow-datafusion-commits is not supported on ec2-t3-xlarge-us-east-2] [ec2-t3-xlarge-us-east-2](https://conbench.ursa.dev/compare/runs/ac82cebba10e4930a41ff8295eb92015...80183f872082444ab06ea3ef4ed817e3/)
   [Skipped :warning: Benchmarking of arrow-datafusion-commits is not supported on test-mac-arm] [test-mac-arm](https://conbench.ursa.dev/compare/runs/3d7fc9cd93e04af9884721475d3c6bd2...c06c0137577541fcb14605098f8f9814/)
   [Skipped :warning: Benchmarking of arrow-datafusion-commits is not supported on ursa-i9-9960x] [ursa-i9-9960x](https://conbench.ursa.dev/compare/runs/3c1cb95f359647e0874db55dbaefd781...0a0cd71862db465ebe34a2a78d2acbed/)
   [Skipped :warning: Benchmarking of arrow-datafusion-commits is not supported on ursa-thinkcentre-m75q] [ursa-thinkcentre-m75q](https://conbench.ursa.dev/compare/runs/fd4b33f0ff764b4ab55e5dd56c160748...493e78d8f413419f864ab8d6e0d7b97d/)
   Buildkite builds:
   Supported benchmarks:
   ec2-t3-xlarge-us-east-2: Supported benchmark langs: Python, R. Runs only benchmarks with cloud = True
   test-mac-arm: Supported benchmark langs: C++, Python, R
   ursa-i9-9960x: Supported benchmark langs: Python, R, JavaScript
   ursa-thinkcentre-m75q: Supported benchmark langs: C++, Java
   


-- 
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] jackwener commented on a diff in pull request #4208: Add try_optimize method

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


##########
datafusion/optimizer/src/decorrelate_where_exists.rs:
##########
@@ -20,7 +20,7 @@ use crate::utils::{
     verify_not_disjunction,
 };
 use crate::{utils, OptimizerConfig, OptimizerRule};
-use datafusion_common::{context, plan_err, DataFusionError};
+use datafusion_common::context;

Review Comment:
   keep `DataFusionError`, following code we can use `Result` instead of `datafusion_common::Result` 



-- 
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] jackwener commented on pull request #4208: Add try_optimize method

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

   > Will we remove the existing optimize function in the future?
   
   IMO, It depends on can we refactor all rule, when we do all job, we can remove.


-- 
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 diff in pull request #4208: Add try_optimize method

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


##########
datafusion/optimizer/src/decorrelate_where_exists.rs:
##########
@@ -20,7 +20,7 @@ use crate::utils::{
     verify_not_disjunction,
 };
 use crate::{utils, OptimizerConfig, OptimizerRule};
-use datafusion_common::{context, plan_err, DataFusionError};
+use datafusion_common::context;

Review Comment:
   Or maybe we could just do `use datafusion_common::Result`



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