-
Notifications
You must be signed in to change notification settings - Fork 5.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
*: handle signed/unsigned in the partition pruning #15436
Conversation
Some fail cases are range columns partition, we have to merge this one first |
pruner := rangePruner{lessThan, col, fn} | ||
pruner := rangePruner{ | ||
lessThan: lessThanDataInt{ | ||
data: partExpr.ForRangePruning.LessThan, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using copy here is better? Copy could avoid race here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's read-only data... free from data race, so the copy is unnecessary.
The LessThan
is different from expression.Expression
or ast.StmtNode
The visit function modify the node like here:
node.XX = XX.Accept(Visitor)
And the expression is also modified during use (ugly code).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
PTAL @lysu |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rest LGTM
/run-all-tests |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Codecov Report
@@ Coverage Diff @@
## master #15436 +/- ##
===========================================
Coverage 80.7970% 80.7970%
===========================================
Files 503 503
Lines 136021 136021
===========================================
Hits 109901 109901
Misses 17687 17687
Partials 8433 8433 |
What problem does this PR solve?
Problem Summary:
The old
lessThanData
use int64 for data representation.However, the partition by range less than value can be signed or unsigned.
If it's unsigned, it may be out of the int64 range.
What is changed and how it works?
What's Changed:
makeLessThanData
processing to the table creating to reduce allocationexpression.ParseSimpleExprsWithNames
How it Works:
Compare function now use an unsigned flag to handle the unsigned case.
Related changes
Check List
Tests
Release note