apache / apache/paimon

[Bug] URISyntaxException when run test on windows

Open
#3,803 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Java
Stars
3.4k
Forks
1.4k
Avg merge
1d 11h
Merged PRs (30d)
396

Description

### Search before asking

- [X] I searched in the [issues](https://github.com/apache/paimon/issues) and found nothing similar.

### Paimon version

0.9-SNAPSHOT

### Compute Engine

flink

### Minimal reproduce step

On my windows laptop,execute :

```shell
mvn -Dtest=HashBucketAssignerTest#testAssign test
```

### What doesn't meet your expectations?

current url : traceable://C:%25255CUsers%25255Cgaoxiong%25255CAppData%25255CLocal%25255CTemp%25255Cjunit4564634346496172550**user.sys**

it should add slash between uri and path : traceable://C:%25255CUsers%25255Cgaoxiong%25255CAppData%25255CLocal%25255CTemp%25255Cjunit4564634346496172550 **/user.sys**

log :

```log
[INFO] -------------------------------------------------------
[INFO] T E S T S
[INFO] -------------------------------------------------------
[INFO] Running org.apache.paimon.index.HashBucketAssignerTest
[ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 1.391 s <<< FAILURE! - in org.apache.paimon.index.HashBucketAssignerTest
[ERROR] org.apache.paimon.index.HashBucketAssignerTest.testAssign Time elapsed: 1.333 s <<< ERROR!
java.lang.IllegalArgumentException: java.net.URISyntaxException: Relative path in absolute URI: traceable://C:%25255CUsers%25255Cgaoxiong%25255CAppData%25255CLocal%25255CTemp%25255Cjunit4564634346496172550user.sys
at org.apache.paimon.fs.Path.initialize(Path.java:235)
at org.apache.paimon.fs.Path.(Path.java:119)
at org.apache.paimon.fs.Path.(Path.java:72)
at org.apache.paimon.privilege.FileBasedPrivilegeManager.getTable(FileBasedPrivilegeManager.java:366)
at org.apache.paimon.privilege.FileBasedPrivilegeManager.getUserTable(FileBasedPrivilegeManager.java:352)
at org.apache.paimon.privilege.FileBasedPrivilegeManager.privilegeEnabled(FileBasedPrivilegeManager.java:118)
at org.apache.paimon.catalog.FileSystemCatalogFactory.create(FileSystemCatalogFactory.java:55)
at org.apache.paimon.catalog.CatalogFactory.createCatalog(CatalogFactory.java:95)
at org.apache.paimon.catalog.CatalogFactory.createCatalog(CatalogFactory.java:66)
at org.apache.paimon.catalog.PrimaryKeyTableTestBase.beforeEachBase(PrimaryKeyTableTestBase.java:61)
```

### Anything else?

_No response_

### Are you willing to submit a PR?

- [X] I'm willing to submit a PR!

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the failure with `mvn -Dtest=HashBucketAssignerTest#testAssign test` on Windows, then inspect `org.apache.paimon.fs.Path.initialize` and the `FileBasedPrivilegeManager` call site shown in the stack trace. Compare the generated URI with the expected slash-separated path and confirm that `HashBucketAssignerTest#testAssign` passes on Windows.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.