Skip to content

[Bug] PVFS working directory is the raw init URI, not the catalog root #9506

Description

@thswlsqls

Search before asking

  • I searched in the issues and found nothing similar.

Paimon version
master @ da71a66 (2.1-SNAPSHOT)

Compute Engine
Engine-agnostic (Hadoop FileSystem SDK, paimon-vfs-hadoop)

Minimal reproduce step
PaimonVirtualFileSystem.initialize() (paimon-vfs/paimon-vfs-hadoop/src/main/java/org/apache/paimon/vfs/hadoop/PaimonVirtualFileSystem.java line 70) sets workingDirectory = new Path(uri) from the raw URI Hadoop passes in, while line 74 normalizes this.uri to scheme://authority/.

Following the documented usage in docs/docs/concepts/rest/pvfs.md lines 61-62:

Path path = new Path("pvfs://catalog/db_a/tbl_a/a.csv");
FileSystem fs = path.getFileSystem(conf);
fs.create(new Path("db_b/tbl_b/b.csv"));

What doesn't meet your expectations?
Expected: the working directory is the catalog root, so a relative path resolves under the table it names. Actual: the instance contradicts itself — getUri() returns pvfs://catalog/ but getWorkingDirectory() returns pvfs://catalog/db_a/tbl_a/a.csv. The create above raises no exception and writes into db_a/tbl_a.

Anything else?
Which table receives the write is non-deterministic: the Hadoop FileSystem cache key is scheme+authority+ugi, so it depends on which path first opened a pvfs FileSystem in that JVM.

Are you willing to submit a PR?

  • I'm willing to submit a PR!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions