kinolaev commented on code in PR #17196:
URL: https://github.com/apache/iceberg/pull/17196#discussion_r3590862095


##########
core/src/main/java/org/apache/iceberg/avro/SchemaToType.java:
##########
@@ -193,19 +196,30 @@ public Type logicalType(Schema primitive, LogicalType 
logical) {
 
     } else if (logical instanceof LogicalTypes.TimestampMillis
         || logical instanceof LogicalTypes.TimestampMicros) {
-      if (AvroSchemaUtil.isTimestamptz(primitive)) {
+      if (AvroSchemaUtil.isTimestamptz(primitive, legacyTimestampMapping)) {
         return Types.TimestampType.withZone();
       } else {
         return Types.TimestampType.withoutZone();
       }
 
     } else if (logical instanceof LogicalTypes.TimestampNanos) {
-      if (AvroSchemaUtil.isTimestamptz(primitive)) {
+      if (AvroSchemaUtil.isTimestamptz(primitive, legacyTimestampMapping)) {
         return Types.TimestampNanoType.withZone();
       } else {
         return Types.TimestampNanoType.withoutZone();
       }
 
+    } else if (logical instanceof LogicalTypes.LocalTimestampMillis

Review Comment:
   Dropping the condition introduces a breaking change: if someone uses 
`AvroSchemaUtil.toIcebergSchema` to write externally produced Avro data with 
`local-timestamp-*`, their pipeline will fail after the upgrade because the 
`long` columns will become `timestamp`s. We discussed this above 
https://github.com/apache/iceberg/pull/17196#issuecomment-4975172209. Does it 
look like a breaking change to you, @RussellSpitzer ? Do you prefer to support 
`local-timestamp-*` unconditionally?
   
   I don't know any real consumer that relies on ignoring `local-timestamp-*` 
and I'm ready to drop the condition. Just wanted to highlight this first.



-- 
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]

Reply via email to