-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
[Feature] Support sort key be able to nullable. #15641
[Feature] Support sort key be able to nullable. #15641
Conversation
clang-tidy review says "All clean, LGTM! 👍" |
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
buff.clear(); | ||
for (int j = 0; j < ncol; j++) { | ||
if (cols[j]->is_null(i)) { | ||
buff.push_back(SORT_KEY_NULL_FIRST_MARKER); |
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.
If the data is also started as 0x00, how to handle it?
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.
If the data is also started as 0x00, how to handle it?
If we're a middle component of a composite key, we need to add a \x00 at the end in order to separate this component from the next one. However, if we just did that, we'd have issues where a key that actually has \x00 in it would compare wrong, so we have to instead add \x00\x00, and encode \x00 as \x00\x01.
@@ -238,9 +241,6 @@ inline Status decode_slice(Slice* src, std::string* dest, bool is_last) { | |||
} | |||
|
|||
bool PrimaryKeyEncoder::is_supported(const VectorizedField& f) { | |||
if (f.is_nullable()) { | |||
return false; | |||
} |
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.
Will this affect Primary Key's restriction? so primary key still don't support nulllable yet?
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.
Will this affect Primary Key's restriction? so primary key still don't support nulllable yet?
Yes, the keys of PrimaryKey table should not be nullable.
run starrocks_admit_test |
Support sort key be able to nullable. Signed-off-by: zhangqiang <qiangzh95@gmail.com>
Support sort key be able to nullable. Signed-off-by: zhangqiang <qiangzh95@gmail.com>
What type of PR is this:
Which issues of this PR fixes :
Fixes #15057
close #14289
Problem Summary(Required) :
Sort key should can be nullable, this PR support it. In primary key encoder, when encode a nullable column, if the datum is null, fill a null marker in the front of it, if the datum is not null, just fill a normal marker in the front of it.
Checklist:
Bugfix cherry-pick branch check: