Zouxxyy commented on code in PR #6014:
URL: https://github.com/apache/paimon/pull/6014#discussion_r2249135882


##########
paimon-core/src/main/java/org/apache/paimon/utils/FormatReaderMapping.java:
##########
@@ -174,7 +174,7 @@ public FormatReaderMapping build(
                 String formatIdentifier, TableSchema tableSchema, TableSchema 
dataSchema) {
 
             // extract the whole data fields in logic.
-            List<DataField> allDataFields = fieldsExtractor.apply(dataSchema);
+            List<DataField> allDataFields = new 
ArrayList<>(fieldsExtractor.apply(dataSchema));

Review Comment:
   The fieldsExtractor here directly retrieves the fields list from the 
`dataSchema`. Adding fields directly can introduce unknown bugs.
   
   So I changed the fields in the `TableSchema` to be unmodifiable.
   `this.fields = Collections.unmodifiableList(new ArrayList<>(fields));`



-- 
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...@paimon.apache.org

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

Reply via email to