refactor(predicate): move predicate_utils.h to public include#181
Merged
zjw1111 merged 1 commit intoalibaba:mainfrom Mar 17, 2026
Merged
Conversation
Move predicate_utils.h from src/paimon/common/predicate/ to include/paimon/predicate/ to expose it as a public API header. Changes: - Relocate predicate_utils.h to include/paimon/predicate/ - Update all include paths across the codebase - Remove fmt/format.h dependency from header - Replace fmt::format with string concatenation in error msg Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR refactors predicate utilities to be consumed via a public API header (include/paimon/predicate/predicate_utils.h) so predicate-tree column indexing can be aligned with the final read schema in downstream integrations.
Changes:
- Switched all in-tree includes from the internal
paimon/common/predicate/predicate_utils.hpath to the publicpaimon/predicate/predicate_utils.h. - Updated
predicate_utils.hto avoid depending onfmt(making it lighter/safer as a public header). - Updated predicate utils unit/implementation includes accordingly.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/paimon/format/orc/predicate_converter.cpp | Uses the public predicate utils header. |
| src/paimon/core/utils/field_mapping.cpp | Uses the public predicate utils header. |
| src/paimon/core/operation/merge_file_split_read.cpp | Uses the public predicate utils header. |
| src/paimon/core/operation/key_value_file_store_scan.cpp | Uses the public predicate utils header. |
| src/paimon/core/operation/file_store_scan.cpp | Uses the public predicate utils header. |
| src/paimon/core/operation/append_only_file_store_scan.cpp | Uses the public predicate utils header. |
| src/paimon/core/io/file_index_evaluator.cpp | Uses the public predicate utils header. |
| src/paimon/core/global_index/global_index_evaluator_impl.cpp | Uses the public predicate utils header. |
| src/paimon/common/predicate/predicate_utils_test.cpp | Updates tests to include the public predicate utils header. |
| src/paimon/common/predicate/predicate_utils.cpp | Updates implementation to include the public predicate utils header. |
| include/paimon/predicate/predicate_utils.h | Makes header more suitable as public API (drops fmt usage; adjusts error construction). |
Comments suppressed due to low confidence (2)
include/paimon/predicate/predicate_utils.h:25
PredicateUtilsuses theassert(...)macro in this header (e.g., inVisitPredicate), but the header doesn't include<cassert>. As a public header, it should include all headers it directly relies on; otherwise consumers may fail to compile depending on include order.
include/paimon/predicate/predicate_utils.h:117Status::Invalidis variadic and can accept multiple arguments; building the message via"invalid " + ... + " function..."creates temporary strings unnecessarily. Consider passing the parts as separate arguments toStatus::Invalid(...)to avoid extra allocations (especially since this is in a header template).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
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.
Under some scenarios, the column index of predicate tree needs to be correct by the final read schema.
So move predicate_utils.h from src/paimon/common/predicate/ to include/paimon/predicate/ to expose it as a public API header.