You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by GitBox <gi...@apache.org> on 2021/06/10 02:39:50 UTC
[GitHub] [incubator-doris] huangmengbin opened a new pull request #5991: [Bug] Fix range partition pruner bug
huangmengbin opened a new pull request #5991:
URL: https://github.com/apache/incubator-doris/pull/5991
## Proposed changes
- Fix the bug in issue [5989](https://github.com/apache/incubator-doris/issues/5989).
```sql
CREATE TABLE xxx ( ..... )
UNIQUE KEY (`a`,`b`,`c`)
PARTITION BY RANGE (`a`,`b`,`c`) (
PARTITION p VALUES LESS THAN ('0')
) ......
```
```sql
INSERT INTO xxx VALUES ('-1', '-1', '-1' .... );
```
```sql
EXPLAIN SELECT * FROM xxx where a > 0;
EXPLAIN SELECT * FROM xxx where a >= 0;
```
- Before fix the bug,the result of explain contains "partitions=1/1"
- After fix the bug,the result of explain contains "partitions=0/1"
## Types of changes
- [x] Bugfix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] Documentation Update (if none of the other choices apply)
- [ ] Code refactor (Modify the code structure, format the code, etc...)
## Checklist
- [x] I have created an issue on [5989](https://github.com/apache/incubator-doris/issues/5989) and described the bug there in detail
- [x] Compiling and unit tests pass locally with my changes
- [x] I have added tests that prove my fix is effective or that my feature works
- [ ] If these changes need document changes, I have updated the document
- [ ] Any dependent changes have been merged
## Further comments
--
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
[GitHub] [incubator-doris] huangmengbin commented on pull request #5991: [Bug] Fix range partition pruner bug
Posted by GitBox <gi...@apache.org>.
huangmengbin commented on pull request #5991:
URL: https://github.com/apache/incubator-doris/pull/5991#issuecomment-859226197
Hi, @morningman, the bug has been fixed. Please review again. 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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
[GitHub] [incubator-doris] huangmengbin commented on a change in pull request #5991: [Bug] Fix range partition pruner bug
Posted by GitBox <gi...@apache.org>.
huangmengbin commented on a change in pull request #5991:
URL: https://github.com/apache/incubator-doris/pull/5991#discussion_r672842686
##########
File path: fe/fe-core/src/main/java/org/apache/doris/planner/RangePartitionPruner.java
##########
@@ -75,19 +75,21 @@ public RangePartitionPruner(Map<Long, PartitionItem> rangeMap,
Column keyColumn = partitionColumns.get(columnIdx);
PartitionColumnFilter filter = partitionColumnFilters.get(keyColumn.getName());
if (null == filter) {
- minKey.pushColumn(LiteralExpr.createInfinity(Type.fromPrimitiveType(keyColumn.getDataType()), false),
- keyColumn.getDataType());
- maxKey.pushColumn(LiteralExpr.createInfinity(Type.fromPrimitiveType(keyColumn.getDataType()), true),
- keyColumn.getDataType());
+ int pushMinCount = minKey.fillWithInfinity(partitionColumns, false);
Review comment:
> If there is no condition in the first column, should we directly add the infinity range of the first column, right?
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: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
[GitHub] [incubator-doris] huangmengbin commented on a change in pull request #5991: [Bug] Fix range partition pruner bug
Posted by GitBox <gi...@apache.org>.
huangmengbin commented on a change in pull request #5991:
URL: https://github.com/apache/incubator-doris/pull/5991#discussion_r672842686
##########
File path: fe/fe-core/src/main/java/org/apache/doris/planner/RangePartitionPruner.java
##########
@@ -75,19 +75,21 @@ public RangePartitionPruner(Map<Long, PartitionItem> rangeMap,
Column keyColumn = partitionColumns.get(columnIdx);
PartitionColumnFilter filter = partitionColumnFilters.get(keyColumn.getName());
if (null == filter) {
- minKey.pushColumn(LiteralExpr.createInfinity(Type.fromPrimitiveType(keyColumn.getDataType()), false),
- keyColumn.getDataType());
- maxKey.pushColumn(LiteralExpr.createInfinity(Type.fromPrimitiveType(keyColumn.getDataType()), true),
- keyColumn.getDataType());
+ int pushMinCount = minKey.fillWithInfinity(partitionColumns, false);
Review comment:
> If there is no condition in the first column, should we directly add the infinity range of the first column, right?
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: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
[GitHub] [incubator-doris] huangmengbin commented on a change in pull request #5991: [Bug] Fix range partition pruner bug
Posted by GitBox <gi...@apache.org>.
huangmengbin commented on a change in pull request #5991:
URL: https://github.com/apache/incubator-doris/pull/5991#discussion_r672842686
##########
File path: fe/fe-core/src/main/java/org/apache/doris/planner/RangePartitionPruner.java
##########
@@ -75,19 +75,21 @@ public RangePartitionPruner(Map<Long, PartitionItem> rangeMap,
Column keyColumn = partitionColumns.get(columnIdx);
PartitionColumnFilter filter = partitionColumnFilters.get(keyColumn.getName());
if (null == filter) {
- minKey.pushColumn(LiteralExpr.createInfinity(Type.fromPrimitiveType(keyColumn.getDataType()), false),
- keyColumn.getDataType());
- maxKey.pushColumn(LiteralExpr.createInfinity(Type.fromPrimitiveType(keyColumn.getDataType()), true),
- keyColumn.getDataType());
+ int pushMinCount = minKey.fillWithInfinity(partitionColumns, false);
Review comment:
> If there is no condition in the first column, should we directly add the infinity range of the first column, right?
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: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
[GitHub] [incubator-doris] huangmengbin closed pull request #5991: [Bug] Fix range partition pruner bug
Posted by GitBox <gi...@apache.org>.
huangmengbin closed pull request #5991:
URL: https://github.com/apache/incubator-doris/pull/5991
--
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
[GitHub] [incubator-doris] huangmengbin commented on pull request #5991: [Bug] Fix range partition pruner bug
Posted by GitBox <gi...@apache.org>.
huangmengbin commented on pull request #5991:
URL: https://github.com/apache/incubator-doris/pull/5991#issuecomment-857395374
- Sorry, I haven't fixed the bug completely this time. In the next step I will review all the usage of the "LiteralExpr.createInfinity" function to see if they are necessary to be included in the loop. It is expected that a new PR will be released this week.
--
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
[GitHub] [incubator-doris] huangmengbin commented on a change in pull request #5991: [Bug] Fix range partition pruner bug
Posted by GitBox <gi...@apache.org>.
huangmengbin commented on a change in pull request #5991:
URL: https://github.com/apache/incubator-doris/pull/5991#discussion_r656204388
##########
File path: fe/fe-core/src/main/java/org/apache/doris/planner/RangePartitionPruner.java
##########
@@ -75,19 +75,21 @@ public RangePartitionPruner(Map<Long, PartitionItem> rangeMap,
Column keyColumn = partitionColumns.get(columnIdx);
PartitionColumnFilter filter = partitionColumnFilters.get(keyColumn.getName());
if (null == filter) {
- minKey.pushColumn(LiteralExpr.createInfinity(Type.fromPrimitiveType(keyColumn.getDataType()), false),
- keyColumn.getDataType());
- maxKey.pushColumn(LiteralExpr.createInfinity(Type.fromPrimitiveType(keyColumn.getDataType()), true),
- keyColumn.getDataType());
+ int pushMinCount = minKey.fillWithInfinity(partitionColumns, false);
Review comment:
> If there is no condition in the first column, should we directly add the infinity range of the first column, right?
Yes, it might be true. If the columnIdx is 0, we only need to add an infinity range of the first column. there is no need to add the infinity range for all columns. Thanks for your review !
--
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org