Skip to content

Commit

Permalink
[FLINK-13073][table-blink-runtime] BinaryRow in Blink runtime has wro…
Browse files Browse the repository at this point in the history
…ng FIRST_BYTE_ZERO mask

This closes apache#8961
  • Loading branch information
AjaxXu authored and wuchong committed Jul 4, 2019
1 parent a39ade1 commit 5d0f749
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
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

0 comments on commit 5d0f749

Please sign in to comment.