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

   ### Search before asking
   
   - [x] I searched in the [issues](https://github.com/alibaba/fluss/issues) 
and found nothing similar.
   
   
   ### Description
   
   Currently, when using the Java Client, the user needs to convert back and 
forth to `InternalRow`.
   ```
   public GenericRow toGenericRow() {
               GenericRow row = new 
GenericRow(DeliveryETAEvent.class.getDeclaredFields().length);
               row.setField(0, BinaryString.fromString(orderId));
               row.setField(1, BinaryString.fromString(courierId));
               row.setField(2, BinaryString.fromString(restaurantId));
               row.setField(3, destinationLatitude);
               row.setField(4, destinationLongitude);
               row.setField(5, estimatedPrepTimeSeconds);
               row.setField(6, estimatedTravelTimeSeconds);
               row.setField(7, TimestampNtz.fromLocalDateTime(eventTimestamp));
               return row;
           }
   ```
   This means they might need to know some internals like 
`BinaryString.fromString()` or `TimestampNtz.fromLocalDateTime()`.
   
   I think it will be nice to create a new class that provides two methods, 
`RowConverter.fromRow()` and `RowConverter.toRow()` that uses reflection to 
help abstract away some of this complexity.. This can be useful, especially for 
larger pojos.
   
   We can also introduce some kind of caching layer to speed up the conversion 
to avoid recomputations.
   
   ### Willingness to contribute
   
   - [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