You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hudi.apache.org by "hbgstc123 (via GitHub)" <gi...@apache.org> on 2023/03/17 10:19:07 UTC

[GitHub] [hudi] hbgstc123 commented on a diff in pull request #3769: [HUDI-2005] Fixing partition path creation in AbstractTableFileSystemView

hbgstc123 commented on code in PR #3769:
URL: https://github.com/apache/hudi/pull/3769#discussion_r1140045032


##########
hudi-common/src/main/java/org/apache/hudi/common/table/view/AbstractTableFileSystemView.java:
##########
@@ -317,7 +315,13 @@ private void ensurePartitionLoadedCorrectly(String partition) {
    * @throws IOException
    */
   protected FileStatus[] listPartition(Path partitionPath) throws IOException {
-    return metaClient.getFs().listStatus(partitionPath);
+    // Create the path if it does not exist already
+    if (!metaClient.getFs().exists(partitionPath)) {
+      metaClient.getFs().mkdirs(partitionPath);

Review Comment:
   @nsivabalan hi, may i ask why we need to create dir when not exists. This behavior have a problem after drop partition, clean action will delete the dir. But this dropped partition maybe listed again, and will result in a empty dir, can we just `return new FileStatus[0]; ` here without create new dir.



-- 
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-unsubscribe@hudi.apache.org

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