ConeyLiu commented on code in PR #4577: URL: https://github.com/apache/iceberg/pull/4577#discussion_r851855921
########## core/src/main/java/org/apache/iceberg/avro/BuildAvroProjection.java: ########## @@ -106,10 +106,16 @@ public Schema record(Schema record, List<String> names, Iterable<Schema.Field> s "Missing required field: %s", field.name()); // Create a field that will be defaulted to null. We assign a unique suffix to the field // to make sure that even if records in the file have the field it is not projected. + String origFieldName = field.name(); + boolean isValidFieldName = AvroSchemaUtil.validAvroName(origFieldName); + String fieldName = isValidFieldName ? origFieldName : AvroSchemaUtil.sanitize(origFieldName); Review Comment: Updated. -- 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: issues-unsubscr...@iceberg.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org For additional commands, e-mail: issues-h...@iceberg.apache.org