YuweiXiao commented on code in PR #6680:
URL: https://github.com/apache/hudi/pull/6680#discussion_r1000209438


##########
hudi-common/src/main/java/org/apache/hudi/BaseHoodieTableFileIndex.java:
##########
@@ -310,35 +256,159 @@ private void doRefresh() {
             )
         );
 
-    cachedFileSize = cachedAllInputFileSlices.values().stream()
+    this.cachedFileSize += ret.values().stream()
         .flatMap(Collection::stream)
         .mapToLong(BaseHoodieTableFileIndex::fileSliceSize)
         .sum();
 
-    // If the partition value contains InternalRow.empty, we query it as a 
non-partitioned table.
-    queryAsNonePartitionedTable = partitionFiles.keySet().stream().anyMatch(p 
-> p.values.length == 0);
+    return ret;
+  }
 
-    long duration = System.currentTimeMillis() - startTime;
+  /**
+   * Get partition path with the given partition value
+   * @param partitionNames partition names
+   * @param values partition values
+   * @return partitions that match the given partition values
+   */
+  protected List<PartitionPath> getPartitionPaths(String[] partitionNames, 
String[] values) {
+    if (cachedAllPartitionPaths != null) {
+      LOG.info("All partition paths have already loaded, use it directly");
+      return cachedAllPartitionPaths;
+    }
 
-    LOG.info(String.format("Refresh table %s, spent: %d ms", 
metaClient.getTableConfig().getTableName(), duration));
+    Pair<String, Boolean> relativeQueryPartitionPathPair = 
composeRelativePartitionPaths(partitionNames, values);

Review Comment:
   Yeah, sure. The construction is based on the partition order from schema 
rather than the input order.



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