QuakeWang commented on code in PR #106:
URL: https://github.com/apache/paimon-rust/pull/106#discussion_r3025668707


##########
crates/paimon/src/io/file_io.rs:
##########
@@ -129,20 +132,22 @@ impl FileIO {
         let mut statuses = Vec::new();
         let list_path_normalized = list_path.trim_start_matches('/');
         for entry in entries {
-            // opendal list_with includes the root directory itself as the 
first entry.
-            // The root entry's path equals list_path (with or without leading 
slash).
-            // Skip it so callers only see the direct children.
             let entry_path = entry.path();
-            let entry_path_normalized = entry_path.trim_start_matches('/');
-            if entry_path_normalized == list_path_normalized {
+            if entry_path.trim_start_matches('/') == list_path_normalized {
                 continue;
             }
-            let meta = entry.metadata();
+            // OpenDAL 0.55 removed list metakey selection, so stat each entry 
to
+            // guarantee FileStatus metadata is populated consistently across 
backends.
+            let meta = op.stat(entry_path).await.context(IoUnexpectedSnafu {

Review Comment:
   > op.stat is a remote IO? If it is, this is a big performance issue.
   
   @JingsongLi Good point. `op.stat()` can become remote IO on object stores, 
and doing that for every listed entry would create an N+1 pattern.
   
    I’ve updated the implementation to avoid per-entry `stat()` in 
`list_status()`. It now uses `entry.metadata()` directly again, so this PR 
stays focused on operator euse and does not introduce extra remote calls during 
listing.



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