LiebingYu opened a new issue, #1819:
URL: https://github.com/apache/fluss/issues/1819

   ### Search before asking
   
   - [x] I searched in the [issues](https://github.com/apache/fluss/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:
   ```java
       @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?
   
   - [x] I'm willing to submit a PR!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to