Skip to content
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

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -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 ? ~0xFFL : ~(0xFFL << 56L);
public static final int HEADER_SIZE_IN_BITS = 8;

public static int calculateBitSetWidthInBytes(int arity) {
Expand Down
Expand Up @@ -289,16 +289,13 @@ public void anyNullTest() throws IOException {
assertTrue(row.anyNull());
}

{
BinaryRow row = new BinaryRow(80);
int numFields = 80;
for (int i = 0; i < numFields; i++) {
BinaryRow row = new BinaryRow(numFields);
BinaryRowWriter writer = new BinaryRowWriter(row);
row.setHeader((byte)17);
assertFalse(row.anyNull());

writer.setNullAt(3);
assertTrue(row.anyNull());

writer = new BinaryRowWriter(row);
writer.setNullAt(65);
writer.setNullAt(i);
assertTrue(row.anyNull());
}
}
Expand Down