-
Notifications
You must be signed in to change notification settings - Fork 405
Description
Search before asking
- I searched in the issues and found nothing similar.
Fluss version
main (development)
Please describe the bug π
When write TIME
values to Fluss, lookup and scan will return different results of the same row. The following code reproduce the problem:
@Test
void testUpsert() throws Exception {
LocalTime time = LocalTime.of(10, 10, 10, 123000000);
long mill = time.toNanoOfDay() / 1_000_000;
System.out.println("write time: " + mill);
Schema schema =
Schema.newBuilder()
.column("a", DataTypes.TIME())
.column("b", DataTypes.INT())
.primaryKey("a", "b")
.build();
TablePath tablePath =
TablePath.of("test_db_1", "test_pk_table_1");
TableDescriptor tableDescriptor =
TableDescriptor.builder().schema(schema).distributedBy(1)
.partitionedBy("a")
.build();
createTable(tablePath, tableDescriptor, false);
try (Table table = conn.getTable(tablePath)) {
UpsertWriter upsertWriter = table.newUpsert().createWriter();
upsertWriter.upsert(row((int) mill, 1)).get();
upsertWriter.flush();
LogScanner logScanner = createLogScanner(table);
// subscribeFromBeginning(logScanner, table);
logScanner.subscribe(0, 0, 0);
ScanRecords scanRecords = logScanner.poll(Duration.ofSeconds(1));
for (ScanRecord scanRecord : scanRecords) {
InternalRow row = scanRecord.getRow();
System.out.println("scan result:" + row.getInt(0));
}
Lookuper lookuper = table.newLookup().createLookuper();
ProjectedRow keyRow = ProjectedRow.from(schema.getPrimaryKeyIndexes());
keyRow.replaceRow(row((int) mill, 1));
InternalRow singletonRow = lookuper.lookup(keyRow).get().getSingletonRow();
System.out.println("lookup result:" + singletonRow.getInt(0));
}
}
The result is:
write time: 36610123
scan result:36610000
lookup result:36610123
Solution
No response
Are you willing to submit a PR?
- I'm willing to submit a PR!