tonymtu commented on code in PR #11247:
URL: https://github.com/apache/paimon/pull/11247#discussion_r4624241532


##########
paimon-filesystems/paimon-jindo/src/main/java/org/apache/paimon/jindo/HadoopCompliantFileIO.java:
##########
@@ -466,9 +488,31 @@ public void close() throws IOException {
     private static class HadoopFileStatus implements FileStatus {
 
         private final org.apache.hadoop.fs.FileStatus status;
+        @Nullable private final org.apache.hadoop.fs.Path listedDirectory;
 
         private HadoopFileStatus(org.apache.hadoop.fs.FileStatus status) {
+            this(status, null);
+        }
+
+        private HadoopFileStatus(
+                org.apache.hadoop.fs.FileStatus status,
+                @Nullable org.apache.hadoop.fs.Path listedDirectory) {
             this.status = status;
+            this.listedDirectory = listedDirectory;
+        }
+
+        @Nullable
+        @Override
+        public String getStorageClass() {
+            // Listing a single file can return a basic status with a default 
storage class.
+            if (listedDirectory != null
+                    && status instanceof JindoHadoopFileStatus
+                    && status.isFile()
+                    && listedDirectory.equals(status.getPath().getParent())) {

Review Comment:
   Thanks for catching this. Fixed in 1606936dd9 by normalizing the directory 
path the same way Jindo does before comparing it with the child’s parent. I 
added regression coverage for both listStatus and listStatusIterative and 
verified on OSS with Jindo 6.9.1 that both methods report Archive with or 
without the trailing slash.



##########
paimon-filesystems/paimon-jindo/src/main/java/org/apache/paimon/jindo/HadoopCompliantFileIO.java:
##########
@@ -466,9 +488,31 @@ public void close() throws IOException {
     private static class HadoopFileStatus implements FileStatus {
 
         private final org.apache.hadoop.fs.FileStatus status;
+        @Nullable private final org.apache.hadoop.fs.Path listedDirectory;
 
         private HadoopFileStatus(org.apache.hadoop.fs.FileStatus status) {
+            this(status, null);
+        }
+
+        private HadoopFileStatus(
+                org.apache.hadoop.fs.FileStatus status,
+                @Nullable org.apache.hadoop.fs.Path listedDirectory) {
             this.status = status;
+            this.listedDirectory = listedDirectory;
+        }
+
+        @Nullable
+        @Override
+        public String getStorageClass() {
+            // Listing a single file can return a basic status with a default 
storage class.
+            if (listedDirectory != null
+                    && status instanceof JindoHadoopFileStatus
+                    && status.isFile()
+                    && listedDirectory.equals(status.getPath().getParent())) {

Review Comment:
   Thanks for catching this. Fixed in 1606936dd9 by normalizing the directory 
path the same way Jindo does before comparing it with the child’s parent. I 
added regression coverage for both listStatus and listStatusIterative and 
verified on OSS with Jindo 6.9.1 that both methods report Archive with or 
without the trailing slash.



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