LiangRuoShui opened a new issue, #11430:
URL: https://github.com/apache/paimon/issues/11430

   ### Search before asking
   
   - [x] Searched existing issues and PRs for `Relative path in absolute URI`, 
`LocalFileIO`, and colon-containing tag names. The similar exception in #3803 
and #11394 occurs on different code paths.
   
   ### Paimon version
   
   Paimon 1.3.1, Linux, OpenJDK 11.0.28.
   
   ### Compute Engine
   
   Java API only. No compute engine or Paimon table is required.
   
   ### Minimal reproduce step
   
   Run this in JShell with `paimon-bundle:1.3.1` and `slf4j-api` on the 
classpath:
   
   ```java
   import java.nio.file.Files;
   import org.apache.paimon.fs.Path;
   import org.apache.paimon.fs.local.LocalFileIO;
   
   var directory = Files.createTempDirectory("paimon-local-list");
   var child = Files.createFile(directory.resolve("tag-demo:old"));
   var fileIO = LocalFileIO.create();
   try {
       fileIO.getFileStatus(new Path(child.toUri())); // succeeds
       fileIO.listStatus(new Path(directory.toString())); // throws
   } finally {
       Files.deleteIfExists(child);
       Files.deleteIfExists(directory);
   }
   ```
   
   ### What doesn't meet your expectations?
   
   Expected: `listStatus()` returns the status of `tag-demo:old`, which is a 
valid filename on the Linux filesystem and can already be accessed by its full 
URI.
   
   Actual: listing the entire directory fails:
   
   ```text
   java.lang.IllegalArgumentException: java.net.URISyntaxException: Relative 
path in absolute URI: tag-demo:old
       at org.apache.paimon.fs.Path.initialize(Path.java:231)
       at org.apache.paimon.fs.Path.<init>(Path.java:181)
       at org.apache.paimon.fs.Path.<init>(Path.java:78)
       at 
org.apache.paimon.fs.local.LocalFileIO.listStatus(LocalFileIO.java:130)
   ```
   
   ### Anything else?
   
   `LocalFileIO.listStatus()` passes the bare filename into `new Path(parent, 
childName)`. That constructor parses the child as a standalone path before 
resolving it against the parent, so the text before `:` is interpreted as a URI 
scheme. Constructing the `Path` from the actual child file's full URI avoids 
that interpretation, as the `getFileStatus()` call above demonstrates.
   
   This also affects Paimon tags on a local warehouse: a tag such as `demo:old` 
can be written by its full path, but its presence makes subsequent tag 
enumeration fail, including enumeration of unrelated tags in the same directory.
   


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