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


##########
core/src/main/java/org/apache/iceberg/data/avro/DataReader.java:
##########
@@ -49,21 +49,37 @@ public static <D> DataReader<D> create(
 
   public static <D> DataReader<D> create(
       org.apache.iceberg.Schema expectedSchema, Schema readSchema, 
Map<Integer, ?> idToConstant) {
-    return new DataReader<>(expectedSchema, readSchema, idToConstant);
+    return create(expectedSchema, readSchema, idToConstant, true);
+  }
+
+  public static <D> DataReader<D> create(

Review Comment:
   I added the `read.avro.adjust-to-utc.default` (defaulting to `false`) table 
property and wired it to the readers and writers through the new 
`SupportsLocalTimestamp` interface. No weird hardcoded booleans left!
   
   Unfortunately, table properties aren't passed to `ReadBuilder` instances. I 
think wiring table properties to all `ReadBuilder`s is beyond the scope of this 
PR, which is why I left the property undocumented for now.
   
   Once that wiring is in place, setting this property to `true` will allow 
externally produced Avro files containing `timestamp-*` without `adjust-to-utc` 
to be read correctly.
   
   For `DataWriter` the value of `write.avro.local-timestamp.enabled` is used 
as `adjustToUtcDefault`. That way, even if `adjust-to-utc` is dropped during 
schema conversion, the writer can still write `OffsetDateTime`s.



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