You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@parquet.apache.org by "clairemcginty (via GitHub)" <gi...@apache.org> on 2023/09/20 15:32:31 UTC

[GitHub] [parquet-mr] clairemcginty commented on a diff in pull request #1140: allow read old parquet file which is maked by old api with old avro version which allow wrong default value in schema

clairemcginty commented on code in PR #1140:
URL: https://github.com/apache/parquet-mr/pull/1140#discussion_r1331817509


##########
parquet-avro/src/main/java/org/apache/parquet/avro/AvroReadSupport.java:
##########
@@ -129,10 +129,10 @@ public RecordMaterializer<T> prepareForRead(
       avroSchema = new Schema.Parser().parse(metadata.get(AVRO_READ_SCHEMA_METADATA_KEY));
     } else if (keyValueMetaData.get(AVRO_SCHEMA_METADATA_KEY) != null) {
       // use the Avro schema from the file metadata if present
-      avroSchema = new Schema.Parser().parse(keyValueMetaData.get(AVRO_SCHEMA_METADATA_KEY));
+      avroSchema = new Schema.Parser().setValidateDefaults(false).parse(keyValueMetaData.get(AVRO_SCHEMA_METADATA_KEY));

Review Comment:
   This does seem potentially scary - maybe it would be safest to make this a Configuration option that the user can opt into?



-- 
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: dev-unsubscribe@parquet.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org