wuchong commented on PR #1877: URL: https://github.com/apache/fluss/pull/1877#issuecomment-3752799997
Thanks for the contribution, @hemanthsavasere! I appreciate the intent behind this change, but I have some concerns about introducing type widening in POJO ↔ Row conversion. While it’s true that widening conversions (e.g., int → long) are safe in one direction—since they don’t lose precision—the challenge here is that POJO-Row conversion is bidirectional: it’s used both on the sink side (POJO → Row) and the source side (Row → POJO). For example, suppose a table column is defined as `BIGINT`. If we allow a POJO to use `int` (relying on widening during write), that same POJO would fail or silently lose data when used for reading—because converting the stored `long` value back to `int` is a narrowing conversion that can cause overflow or precision loss. To ensure correctness and consistency across both source and sink, I think we have to strict type alignment between the POJO fields and the table schema. This is also consistent with how Avro SpecificRecord works—it mandates exact type matching with the Avro schema to avoid ambiguity and runtime errors. -- 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]
