wuchong commented on issue #1844: URL: https://github.com/apache/fluss/issues/1844#issuecomment-3765381571
I brought my comment from the pull request to the issue to have a broader discussion. What's your opinion @polyzos @hemanthsavasere @snuyanzin ? ---------- 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]
