danny0405 commented on code in PR #11031:
URL: https://github.com/apache/hudi/pull/11031#discussion_r1568078034


##########
hudi-flink-datasource/hudi-flink/src/main/java/org/apache/hudi/table/format/mor/MergeOnReadTableState.java:
##########
@@ -83,11 +96,20 @@ public int getOperationPos() {
   }
 
   public int[] getRequiredPositions() {
-    final List<String> fieldNames = rowType.getFieldNames();
-    return requiredRowType.getFieldNames().stream()
-        .map(fieldNames::indexOf)
-        .mapToInt(i -> i)
-        .toArray();
+    List<String> fieldNames = rowType.getFieldNames();
+    List<String> expColumns = new ArrayList<>();
+    int[] pos = requiredRowType.getFieldNames().stream()
+            .mapToInt(fn -> {
+              if (!fieldNames.contains(fn.toLowerCase())) {
+                expColumns.add(fn);
+              }
+              return fieldNames.indexOf(fn.toLowerCase());
+            })
+            .toArray();
+    if (!expColumns.isEmpty()) {
+      throw new HoodieException("Column(s) " + String.join(", ", expColumns) + 
" does not exists in the hudi table " + this.tableName + ".");
+    }

Review Comment:
   Column(s) [`$col_a`, `$col_b`, `$col_c` ...] does not exist in the table 
`$tableName`.



-- 
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: commits-unsubscr...@hudi.apache.org

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

Reply via email to