zhangyue19921010 commented on code in PR #13060:
URL: https://github.com/apache/hudi/pull/13060#discussion_r2027283458


##########
hudi-flink-datasource/hudi-flink/src/main/java/org/apache/hudi/table/HoodieTableSource.java:
##########
@@ -365,16 +368,16 @@ private PartitionPruners.PartitionPruner 
createPartitionPruner(List<ResolvedExpr
         .build();
   }
 
-  private int getDataBucket(List<ResolvedExpression> dataFilters) {
+  private Option<Function<Integer, Integer>> 
getDataBucketFunc(List<ResolvedExpression> dataFilters) {
     if (!OptionsResolver.isBucketIndexType(conf) || dataFilters.isEmpty()) {
-      return PrimaryKeyPruners.BUCKET_ID_NO_PRUNING;
+      return Option.empty();
     }
     Set<String> indexKeyFields = 
Arrays.stream(OptionsResolver.getIndexKeys(conf)).collect(Collectors.toSet());
     List<ResolvedExpression> indexKeyFilters = 
dataFilters.stream().filter(expr -> ExpressionUtils.isEqualsLitExpr(expr, 
indexKeyFields)).collect(Collectors.toList());
     if (!ExpressionUtils.isFilteringByAllFields(indexKeyFilters, 
indexKeyFields)) {
-      return PrimaryKeyPruners.BUCKET_ID_NO_PRUNING;
+      return Option.empty();

Review Comment:
   > It looks like the return value is always non-empty, can we just return the 
function instead of the option instead?
   
   Here also may return `Option.empty()` when `getDataBucketFunc`



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