shangxinli commented on code in PR #957: URL: https://github.com/apache/parquet-mr/pull/957#discussion_r900688194
########## parquet-avro/src/main/java/org/apache/parquet/avro/AvroReadSupport.java: ########## @@ -136,10 +137,22 @@ public RecordMaterializer<T> prepareForRead( GenericData model = getDataModel(configuration); String compatEnabled = metadata.get(AvroReadSupport.AVRO_COMPATIBILITY); - if (compatEnabled != null && Boolean.valueOf(compatEnabled)) { - return newCompatMaterializer(parquetSchema, avroSchema, model); + + try { + if (compatEnabled != null && Boolean.valueOf(compatEnabled)) { + return newCompatMaterializer(parquetSchema, avroSchema, model); + } + return new AvroRecordMaterializer<T>(parquetSchema, avroSchema, model); + } catch (InvalidRecordException | ClassCastException e) { Review Comment: I understand the targetted issue can be solved by this retry with a converted schema. But I am not sure if it is safe to just ignore Avro schema in case of exception. @rdblue @wesm Do you have some time to have a look at this? ########## parquet-avro/src/main/java/org/apache/parquet/avro/AvroReadSupport.java: ########## @@ -136,10 +137,22 @@ public RecordMaterializer<T> prepareForRead( GenericData model = getDataModel(configuration); String compatEnabled = metadata.get(AvroReadSupport.AVRO_COMPATIBILITY); - if (compatEnabled != null && Boolean.valueOf(compatEnabled)) { - return newCompatMaterializer(parquetSchema, avroSchema, model); + + try { + if (compatEnabled != null && Boolean.valueOf(compatEnabled)) { + return newCompatMaterializer(parquetSchema, avroSchema, model); + } + return new AvroRecordMaterializer<T>(parquetSchema, avroSchema, model); + } catch (InvalidRecordException | ClassCastException e) { Review Comment: I understand the target issue can be solved by this retry with a converted schema. But I am not sure if it is safe to just ignore Avro schema in case of exception. @rdblue @wesm Do you have some time to have a look at this? -- 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-unsubscr...@parquet.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org