fix(fs): normalize local filesystem paths#335
Merged
Conversation
lxy-9602
reviewed
Jun 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose
Linked issue: N/A
This PR fixes several filesystem and system-field handling issues:
LocalFileSystem::Rename, sofile:URIs are not passed raw to::rename.LocalFile::Create, including empty paths as the current directory and relative paths as absolute paths based on the current working directory.LocalFile::Create,LocalFile::GetParentFile, andLocalFile::ListFilesresults throughstd::unique_ptr<LocalFile>so callers use the validated factory and ownership is explicit.LocalFileownership intoLocalInputStream/LocalOutputStream, and make stream creation transfer ownership withstd::unique_ptr<LocalFile>.LocalFile::GetAbsolutePathtoLocalFile::GetPath, and update local file tests to construct files throughLocalFile::Create.PathUtil::GetWorkingDirectoryand use dynamically allocatedgetcwdstorage for deep working directories.ExternalPathProvidersafe for concurrent path generation by replacing unsynchronizedposition_mutation with an atomic round-robin counter.rowkindas a special/system field inSpecialFields::IsSpecialFieldName, matching the already-definedSpecialFields::RowKind()field.Tests
git diff --checkgit diff --cached --checkgit diff --check origin/codex/fix-filesystem-issues..HEADcmake --build build --target paimon-fs-test -j64./build/release/paimon-fs-test./build/release/paimon-fs-test --gtest_filter=LocalFileTest.*main:cmake --build build --target paimon-common-test -j64main:./build/release/paimon-common-test --gtest_filter=ExternalPathProviderTest.*:PathUtilsTest.*main:./build/release/paimon-common-test --gtest_filter=SpecialFieldsTest.*main:./build/release/paimon-common-test --gtest_filter=ExternalPathProviderTest.*cmake --build build --target paimon-common-test -j64is currently blocked by an unrelated Parquet/Arrow API mismatch on the updated branch:WhenBufferedRanges/PreBufferRangesare not available onparquet::ParquetFileReader.API and Format
No storage format or protocol changes. This adds an internal
PathUtil::GetWorkingDirectoryhelper, renames an internalLocalFilepath accessor toGetPath, and changes internal local-file ownership APIs to usestd::unique_ptr<LocalFile>.Documentation
No.
Generative AI tooling
Generated-by: OpenAI Codex