xushiyan commented on code in PR #18074:
URL: https://github.com/apache/hudi/pull/18074#discussion_r2776454842


##########
hudi-flink-datasource/hudi-flink/src/main/java/org/apache/hudi/table/HoodieTableSource.java:
##########
@@ -663,20 +663,17 @@ private HoodieSchema inferSchemaFromDdl() {
   }
 
   @Override
-  public FileIndex buildFileIndex() {
-    if (this.fileIndex == null) {
-      this.fileIndex = FileIndex.builder()
-          .path(this.path)
-          .conf(this.conf)
-          .rowType(this.tableRowType)
-          .metaClient(metaClient)
-          .columnStatsProbe(this.columnStatsProbe)
-          .partitionPruner(this.partitionPruner)
-          
.partitionBucketIdFunc(PartitionBucketIdFunc.create(this.dataBucketFunc,
-              this.metaClient, 
conf.get(FlinkOptions.BUCKET_INDEX_NUM_BUCKETS)))
-          .build();
-    }
-    return this.fileIndex;
+  protected FileIndex buildFileIndex() {
+    return FileIndex.builder()

Review Comment:
   explanation: buildFileIndex() should not change object state, just return. 
getOrBuildFileIndex() handles the caching



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