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
[FLINK-13073][table-blink-runtime]BinaryRow in Blink runtime has wrong FIRST_BYTE_ZERO mask #8961
Conversation
Thanks a lot for your contribution to the Apache Flink project. I'm the @flinkbot. I help the community Review Progress
Please see the Pull Request Review Guide for a full explanation of the review process. The Bot is tracking the review progress through labels. Labels are applied according to the order of the review items. For consensus, approval by a Flink committer of PMC member is required Bot commandsThe @flinkbot bot supports the following commands:
|
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.
Thanks @AjaxXu for your good catch, LGTM, just left a test comment.
writer.setNullAt(24); | ||
assertTrue(row.anyNull()); | ||
|
||
writer.setNullAt(55); |
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.
This is useless, because the previous setNull
has allowed anyNull
to return to true.
How about add a test:
int numFields = 80;
for (int i = 0; i < numFields; i++) {
BinaryRow row = new BinaryRow(80);
BinaryRowWriter writer = new BinaryRowWriter(row);
assertFalse(row.anyNull());
writer.setNullAt(i);
assertTrue(row.anyNull());
}
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 a good advise. I will change 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.
LGTM +1
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.
Merging
…ng FIRST_BYTE_ZERO mask This closes apache#8961
Sorry for this pr, I have found a new bug with 0xFFFFFFF0, it's binary sequence is 1111111111111111111111111111111111111111111111111111111111110000. It only have 4 bits of zero, actually it need 8 to skip header. I will fix it later soon. |
@@ -55,7 +55,7 @@ | |||
public final class BinaryRow extends BinaryFormat implements BaseRow { | |||
|
|||
public static final boolean LITTLE_ENDIAN = (ByteOrder.nativeOrder() == ByteOrder.LITTLE_ENDIAN); | |||
private static final long FIRST_BYTE_ZERO = LITTLE_ENDIAN ? 0xFFF0 : 0x0FFF; | |||
private static final long FIRST_BYTE_ZERO = LITTLE_ENDIAN ? 0xFFFFFFFFFFFFFF00L : 0x00FFFFFFFFFFFFFFL; |
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.
Actually I want to use ~0xFFL instead. But I'm not sure what the perform in big endian.
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.
~0xFFL
and ~(0xFFL << 56L)
?
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.
After test, it seems to that have the same expression with 0xFFFFFFFFFFFFFF00L and 0x00FFFFFFFFFFFFFFL, I am going to use the short expression.
@AjaxXu Good job! Now I think it is ready to be merged. |
Thanks you and Jark's review. |
…ng FIRST_BYTE_ZERO mask This closes apache#8961
…ng FIRST_BYTE_ZERO mask This closes apache#8961
What is the purpose of the change
Fix FIRST_BYTE_ZERO in BinaryRow which in table-runtime-blink module
Brief change log
Verifying this change
Does this pull request potentially affect one of the following parts:
@Public(Evolving)
: (no)Documentation