Skip to content

Conversation

@ccoffline
Copy link
Contributor

Proposed changes

fix to #4833

Types of changes

  • 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

  • I have create an issue on (Fix #ISSUE), and have described the bug/feature there in detail
  • Compiling and unit tests pass locally with my changes
  • [] I have added tests that prove my fix is effective or that my feature works
  • [] If this change need a document change, I have updated the document
  • Any dependent changes have been merged

Further comments

@morningman morningman added the kind/fix Categorizes issue or PR as related to a bug. label Nov 3, 2020
@morningman
Copy link
Contributor

I think if the predicate like substr(dt, 7, 8) in ('09'), we should not do the partition prunner.
So here:
https://github.com/apache/incubator-doris/blob/f40868a4805f0ba503bcca9a9c04f704b61c121b/fe/fe-core/src/main/java/org/apache/doris/planner/SingleNodePlanner.java#L958-L972

We should check if inPredicate.getChild(0) is not a slotRef, do not create partition filter for it.
So it won't goes to the compareLiteral() logic.

@ccoffline
Copy link
Contributor Author

@morningman I think cast CastExpr to LiteralExpr will definitely cause an exception.
I just don't know whether getResultValue() will solve that though I didn't see anything wrong in the test.
https://github.com/apache/incubator-doris/blob/b1c1ffda4a0d5ff2f0be4f9d2f25997a31537ea8/fe/fe-core/src/main/java/org/apache/doris/catalog/PartitionKey.java#L135-L150
I'm not fully understand the logic in partition pruner. Maybe it should be in another PR=.=

@ccoffline ccoffline mentioned this pull request Nov 18, 2020
2 tasks
@ccoffline ccoffline closed this Sep 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/fix Categorizes issue or PR as related to a bug.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants