gurmeetsaran-ant commented on PR #15345:
URL: https://github.com/apache/iceberg/pull/15345#issuecomment-3939825934
Thanks for the review. I investigated further and you're right - with the
current configuration, toIcebergType() correctly maps the
org.apache.kafka.connect.data.Timestamp schema to TimestampType, so the value
goes through convertTimestampValue() and never reaches convertLong().
I added debug logging and confirmed:
- hasValueSchema=true, valueClass=Struct
- __ts_ms schema: type=INT64,
schemaName=org.apache.kafka.connect.data.Timestamp
- toIcebergType result: __ts_ms: optional timestamptz
I was unable to reproduce the original crash with the current setup. The
original failure likely occurred under different conditions (e.g., a
pre-existing table with a LONG column for __ts_ms, or something to do with my
config at the time of error).
That said, convertLong() is a general-purpose conversion method that can
receive any Object. Adding Date support to convertLong() makes it consistent
and prevents a confusing IllegalArgumentException if this edge case is ever hit.
Happy to close this if you feel it's not worth the change or keep it as a
defensive improvement.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]