Copilot commented on code in PR #9306:
URL: https://github.com/apache/seatunnel/pull/9306#discussion_r2084398637


##########
seatunnel-connectors-v2/connector-doris/src/main/java/org/apache/seatunnel/connectors/doris/serialize/SeaTunnelRowSerializer.java:
##########
@@ -45,27 +45,45 @@ public class SeaTunnelRowSerializer implements 
DorisSerializer {
     private final String fieldDelimiter;
     private final boolean enableDelete;
     private final SerializationSchema serialize;
+    private final boolean caseSensitive;
 
     public SeaTunnelRowSerializer(
             String type,
             SeaTunnelRowType seaTunnelRowType,
             String fieldDelimiter,
             boolean enableDelete) {
+        this(type, seaTunnelRowType, fieldDelimiter, enableDelete, true);
+    }
+
+    public SeaTunnelRowSerializer(
+            String type,
+            SeaTunnelRowType seaTunnelRowType,
+            String fieldDelimiter,
+            boolean enableDelete,
+            boolean caseSensitive) {
         this.type = type;
         this.fieldDelimiter = fieldDelimiter;
         this.enableDelete = enableDelete;
-        List<Object> fieldNames = new 
ArrayList<>(Arrays.asList(seaTunnelRowType.getFieldNames()));
+        this.caseSensitive = caseSensitive;
+
+        String[] fieldNames = seaTunnelRowType.getFieldNames();
+        String[] processedFieldNames = new String[fieldNames.length];
+        for (int i = 0; i < fieldNames.length; i++) {
+            processedFieldNames[i] = caseSensitive ? fieldNames[i] : 
fieldNames[i].toLowerCase();

Review Comment:
   Consider using toLowerCase(Locale.ROOT) here as well to avoid potential 
locale-related inconsistencies.
   ```suggestion
               processedFieldNames[i] = caseSensitive ? fieldNames[i] : 
fieldNames[i].toLowerCase(Locale.ROOT);
   ```



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

Reply via email to