fix(fs): normalize local filesystem paths#335
Open
zjw1111 wants to merge 3 commits into
Open
Conversation
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))); | ||
| } |
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.PathUtil::GetCurrentPath.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 --checkcmake --build build --target paimon-common-test -j64cmake --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-testAPI and Format
No storage format or protocol changes. This adds an internal
PathUtil::GetCurrentPathhelper.Documentation
No.
Generative AI tooling
Generated-by: OpenAI Codex