Skip to content

fix(fs): normalize local filesystem paths#335

Open
zjw1111 wants to merge 3 commits into
alibaba:mainfrom
zjw1111:codex/fix-filesystem-issues
Open

fix(fs): normalize local filesystem paths#335
zjw1111 wants to merge 3 commits into
alibaba:mainfrom
zjw1111:codex/fix-filesystem-issues

Conversation

@zjw1111
Copy link
Copy Markdown
Collaborator

@zjw1111 zjw1111 commented Jun 3, 2026

Purpose

Linked issue: N/A

This PR fixes several filesystem and system-field handling issues:

  • Use normalized local paths for LocalFileSystem::Rename, so file: URIs are not passed raw to ::rename.
  • Normalize local file paths through LocalFile::Create, including empty paths as the current directory and relative paths as absolute paths based on the current working directory.
  • Move current-directory lookup into PathUtil::GetCurrentPath.
  • Make ExternalPathProvider safe for concurrent path generation by replacing unsynchronized position_ mutation with an atomic round-robin counter.
  • Treat rowkind as a special/system field in SpecialFields::IsSpecialFieldName, matching the already-defined SpecialFields::RowKind() field.

Tests

  • git diff --check
  • cmake --build build --target paimon-common-test -j64
  • cmake --build build --target paimon-fs-test -j64
  • ./build/release/paimon-common-test --gtest_filter=ExternalPathProviderTest.*:PathUtilsTest.*
  • ./build/release/paimon-common-test --gtest_filter=SpecialFieldsTest.*
  • ./build/release/paimon-common-test --gtest_filter=ExternalPathProviderTest.*
  • ./build/release/paimon-fs-test

API and Format

No storage format or protocol changes. This adds an internal PathUtil::GetCurrentPath helper.

Documentation

No.

Generative AI tooling

Generated-by: OpenAI Codex

Copilot AI review requested due to automatic review settings June 3, 2026 08:41
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@zjw1111 zjw1111 requested a review from Copilot June 3, 2026 09:26
@zjw1111 zjw1111 changed the title fix: normalize local filesystem paths fix(fs): normalize local filesystem paths Jun 3, 2026
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 12 out of 12 changed files in this pull request and generated 1 comment.

Comment on lines +150 to +156
Result<std::string> PathUtil::GetCurrentPath() noexcept {
char cwd[PATH_MAX];
if (getcwd(cwd, sizeof(cwd)) != nullptr) {
return std::string(cwd);
}
return Status::IOError(fmt::format("get current path failed, ec: {}", std::strerror(errno)));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants