clairemcginty commented on code in PR #2993:
URL: https://github.com/apache/parquet-java/pull/2993#discussion_r1723247274


##########
parquet-avro/src/main/java/org/apache/parquet/avro/AvroSchemaConverter.java:
##########
@@ -538,7 +544,7 @@ public Optional<LogicalType> visit(
             LogicalTypeAnnotation.TimeUnit unit = 
timestampLogicalType.getUnit();
             boolean isAdjustedToUTC = timestampLogicalType.isAdjustedToUTC();
 
-            if (isAdjustedToUTC) {
+            if (isAdjustedToUTC || !avroVersionSupportsLocalTimestampTypes()) {

Review Comment:
   I don't think so -- Avro only added the 
[local-timestamp-millis/local-timestamp-micros](https://avro.apache.org/docs/1.11.0/spec.html#Local+timestamp+%28millisecond+precision%29)
 types in 1.10+; in 1.8 it only supports 
[timestamp-milis/timestamp-micros](https://avro.apache.org/docs/1.8.0/spec.html#Logical+Types).
 However, `timestamp-millis`/`timestamp-micros` have always been considered by 
parquet-avro as having property `isAdjustedToUTC = true`: 
https://github.com/apache/parquet-java/blob/apache-parquet-1.14.2-rc1/parquet-avro/src/main/java/org/apache/parquet/avro/AvroSchemaConverter.java#L489-L494
   
   So this PR is just restoring the previous default behavior for 
`timestamp-millis`/`timestamp-micros` types on Avro 1.8--otherwise, they'd 
suddenly start breaking after upgrading from Parquet 1.13 to 1.14



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