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/19 15:24:21 UTC
[GitHub] [arrow-datafusion] jackwener opened a new pull request #2039: fix bug the optimizer rule filter push down
jackwener opened a new pull request #2039:
URL: https://github.com/apache/arrow-datafusion/pull/2039
# Which issue does this PR close?
Closes #2038.
# What changes are included in this PR?
Fix the bug due to break loop cause `used_columns` is wrong.
It will cause the `issue_filters` get wrong `used_columns` param
# Are there any user-facing changes?
None
--
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 #2039: fix bug the optimizer rule filter push down
Posted by GitBox <gi...@apache.org>.
jackwener commented on pull request #2039:
URL: https://github.com/apache/arrow-datafusion/pull/2039#issuecomment-1073030007
Now it's fixed.
```sql
explain verbose select c1, c2 from test where c3 = true and c2 = 0.000001;
+-------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------+
| plan_type | plan |
+-------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------+
| initial_logical_plan | Projection: #test.c1, #test.c2 |
| | Filter: #test.c3 = Boolean(true) AND #test.c2 = Float64(0.000001) |
| | TableScan: test projection=None |
| logical_plan after simplify_expressions | Projection: #test.c1, #test.c2 |
| | Filter: #test.c3 AND #test.c2 = Float64(0.000001) AS test.c3 = Boolean(true) AND test.c2 = Float64(0.000001) |
| | TableScan: test projection=None |
| logical_plan after eliminate_filter | SAME TEXT AS ABOVE |
| logical_plan after common_sub_expression_eliminate | SAME TEXT AS ABOVE |
| logical_plan after eliminate_limit | SAME TEXT AS ABOVE |
| logical_plan after projection_push_down | Projection: #test.c1, #test.c2 |
| | Filter: #test.c3 AND #test.c2 = Float64(0.000001) AS test.c3 = Boolean(true) AND test.c2 = Float64(0.000001) |
| | TableScan: test projection=Some([0, 1, 2]) |
| logical_plan after filter_push_down | Projection: #test.c1, #test.c2 |
| | Filter: #test.c3 AND #test.c2 = Float64(0.000001) |
| | TableScan: test projection=Some([0, 1, 2]), filters=[#test.c3, #test.c2 = Float64(0.000001)] |
| logical_plan after limit_push_down | SAME TEXT AS ABOVE |
| logical_plan after SingleDistinctAggregationToGroupBy | SAME TEXT AS ABOVE |
| logical_plan after ToApproxPerc | SAME TEXT AS ABOVE |
| logical_plan after simplify_expressions | SAME TEXT AS ABOVE |
| logical_plan after eliminate_filter | SAME TEXT AS ABOVE |
| logical_plan after common_sub_expression_eliminate | SAME TEXT AS ABOVE |
| logical_plan after eliminate_limit | SAME TEXT AS ABOVE |
| logical_plan after projection_push_down | SAME TEXT AS ABOVE |
| logical_plan after filter_push_down | SAME TEXT AS ABOVE |
| logical_plan after limit_push_down | SAME TEXT AS ABOVE |
| logical_plan after SingleDistinctAggregationToGroupBy | SAME TEXT AS ABOVE |
| logical_plan after ToApproxPerc | SAME TEXT AS ABOVE |
| logical_plan | Projection: #test.c1, #test.c2 |
| | Filter: #test.c3 AND #test.c2 = Float64(0.000001) |
| | TableScan: test projection=Some([0, 1, 2]), filters=[#test.c3, #test.c2 = Float64(0.000001)]
```
--
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 #2039: fix bug the optimizer rule filter push down
Posted by GitBox <gi...@apache.org>.
jackwener commented on pull request #2039:
URL: https://github.com/apache/arrow-datafusion/pull/2039#issuecomment-1073188069
The result of unit test:
Before
```
let expected ="Projection: #a, #b\
\n Filter: #a = Int64(10)\
\n Filter: #b > Int64(11)\
\n TableScan: test projection=Some([0]), filters=[#a = Int64(10), #b > Int64(11)]";
```
After
```
let expected ="Projection: #a, #b\
\n Filter: #a = Int64(10) AND #b > Int64(11)\
\n TableScan: test projection=Some([0]), filters=[#a = Int64(10), #b > Int64(11)]";
```
--
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 #2039: fix bug the optimizer rule filter push down
Posted by GitBox <gi...@apache.org>.
alamb merged pull request #2039:
URL: https://github.com/apache/arrow-datafusion/pull/2039
--
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] Dandandan edited a comment on pull request #2039: fix bug the optimizer rule filter push down
Posted by GitBox <gi...@apache.org>.
Dandandan edited a comment on pull request #2039:
URL: https://github.com/apache/arrow-datafusion/pull/2039#issuecomment-1073044645
I think the change looks good! Can we add a test to make sure we get the correct plan now without splitting the original expressions into multiple filters?
--
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] Dandandan commented on pull request #2039: fix bug the optimizer rule filter push down
Posted by GitBox <gi...@apache.org>.
Dandandan commented on pull request #2039:
URL: https://github.com/apache/arrow-datafusion/pull/2039#issuecomment-1073044645
I think the change looks good! Can we add a test to make sure we get the correct plan now?
--
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 #2039: fix bug the optimizer rule filter push down
Posted by GitBox <gi...@apache.org>.
jackwener commented on pull request #2039:
URL: https://github.com/apache/arrow-datafusion/pull/2039#issuecomment-1073029790
It's found during I add the `combine_adjacent_filter` rule.
I found that `filter` already is combined in the `/sql/planner.rs`.
The filter split is caused by this bug.
--
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 #2039: fix bug the optimizer rule filter push down
Posted by GitBox <gi...@apache.org>.
jackwener commented on pull request #2039:
URL: https://github.com/apache/arrow-datafusion/pull/2039#issuecomment-1073179151
Yes, add unit test is necessary.
--
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 edited a comment on pull request #2039: fix bug the optimizer rule filter push down
Posted by GitBox <gi...@apache.org>.
jackwener edited a comment on pull request #2039:
URL: https://github.com/apache/arrow-datafusion/pull/2039#issuecomment-1073029129
@liukun4515 @Dandandan @alamb @houqp @yjshen PTAL, thanks!😃❤
--
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 #2039: fix bug the optimizer rule filter push down
Posted by GitBox <gi...@apache.org>.
jackwener commented on pull request #2039:
URL: https://github.com/apache/arrow-datafusion/pull/2039#issuecomment-1073029129
@liukun4515 @Dandandan @alamb @houqp PTAL, thanks!😃❤
--
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] houqp commented on pull request #2039: fix bug the optimizer rule filter push down
Posted by GitBox <gi...@apache.org>.
houqp commented on pull request #2039:
URL: https://github.com/apache/arrow-datafusion/pull/2039#issuecomment-1073068978
LGTM +1 on adding a unit test
--
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