cshuo commented on code in PR #17683:
URL: https://github.com/apache/hudi/pull/17683#discussion_r2646435624


##########
hudi-flink-datasource/hudi-flink/src/main/java/org/apache/hudi/util/ExpressionUtils.java:
##########
@@ -294,6 +301,24 @@ public static Tuple2<List<ResolvedExpression>, 
List<ResolvedExpression>> splitEx
     }
   }
 
+  /**
+   * Filter the filter expressions that only contain indexed columns.
+   */
+  public static List<ResolvedExpression> 
filterExpressionWithIndexedCols(List<ResolvedExpression> expressions, 
HoodieTableMetaClient metaClient, HoodieSchema tableSchema) {
+    if (metaClient == null) {
+      return Collections.emptyList();
+    }
+    HoodieIndexDefinition indexDefinition = 
metaClient.getIndexMetadata().map(indexMeta -> 
indexMeta.getIndexDefinitions().get(PARTITION_NAME_COLUMN_STATS)).orElse(null);
+    if (indexDefinition == null) {
+      return Collections.emptyList();
+    }
+    List<String> indexedCols = 
HoodieTableMetadataUtil.getValidIndexedColumns(indexDefinition, tableSchema, 
metaClient.getTableConfig());
+    return expressions.stream().filter(expr -> {
+      String[] refs = referencedColumns(Collections.singletonList(expr));

Review Comment:
   yes, column name is case-sensitive for flink default sql dialect, and there 
is no config to change the behavior now.



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