Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
jiangxb1987 committed Aug 20, 2018
1 parent 9c1f486 commit ecb26fc
Showing 1 changed file with 26 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -293,4 +293,30 @@ public void testBinaryComparatorWhenSubtractionCanOverflowLongValue() throws Exc

assert(compare(0, 1) < 0);
}

@Test
public void testBinaryComparatorWhenOnlyTheLastColumnDiffers() throws Exception {
int numFields = 4;

UnsafeRow row1 = new UnsafeRow(numFields);
byte[] data1 = new byte[100];
row1.pointTo(data1, computeSizeInBytes(numFields * 8));
row1.setInt(0, 11);
row1.setDouble(1, 3.14);
row1.setInt(2, -1);
row1.setLong(3, 0);

UnsafeRow row2 = new UnsafeRow(numFields);
byte[] data2 = new byte[100];
row2.pointTo(data2, computeSizeInBytes(numFields * 8));
row2.setInt(0, 11);
row2.setDouble(1, 3.14);
row2.setInt(2, -1);
row2.setLong(3, 1);

insertRow(row1);
insertRow(row2);

assert(compare(0, 1) < 0);
}
}

0 comments on commit ecb26fc

Please sign in to comment.