Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -946,7 +946,10 @@ public Object getValue(int i, int j) {
case BOOLEAN:
return ((boolean[]) values[j])[i];
case INT64:
case TIMESTAMP:
return ((long[]) values[j])[i];
case DATE:
return ((LocalDate[]) values[j])[i];
default:
throw new IllegalArgumentException("Unsupported type: " + schemas.get(j).getType());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,12 @@ public void testSerializationAndDeSerialization() {
try {
final ByteBuffer byteBuffer = tablet.serialize();
final Tablet newTablet = Tablet.deserialize(byteBuffer);
assertEquals(newTablet, tablet);
assertEquals(tablet, newTablet);
for (int i = 0; i < rowSize; i++) {
for (int j = 0; j < tablet.getSchemas().size(); j++) {
assertEquals(tablet.getValue(i, j), newTablet.getValue(i, j));
}
}
} catch (final Exception e) {
e.printStackTrace();
fail();
Expand Down Expand Up @@ -132,7 +137,12 @@ public void testSerializationAndDeSerializationWithMoreData() {
try {
final ByteBuffer byteBuffer = tablet.serialize();
final Tablet newTablet = Tablet.deserialize(byteBuffer);
assertEquals(newTablet, tablet);
assertEquals(tablet, newTablet);
for (int i = 0; i < rowSize; i++) {
for (int j = 0; j < tablet.getSchemas().size(); j++) {
assertEquals(tablet.getValue(i, j), newTablet.getValue(i, j));
}
}
} catch (final Exception e) {
e.printStackTrace();
fail();
Expand Down