Skip to content

refactor(predicate): move predicate_utils.h to public include#181

Merged
zjw1111 merged 1 commit intoalibaba:mainfrom
mrdrivingduck:refactor/move-predicate-utils-to-public-include
Mar 17, 2026
Merged

refactor(predicate): move predicate_utils.h to public include#181
zjw1111 merged 1 commit intoalibaba:mainfrom
mrdrivingduck:refactor/move-predicate-utils-to-public-include

Conversation

@mrdrivingduck
Copy link
Contributor

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.

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>
Copilot AI review requested due to automatic review settings March 17, 2026 08:20
Copy link

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

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.h path to the public paimon/predicate/predicate_utils.h.
  • Updated predicate_utils.h to avoid depending on fmt (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

  • PredicateUtils uses the assert(...) macro in this header (e.g., in VisitPredicate), 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:117
  • Status::Invalid is variadic and can accept multiple arguments; building the message via "invalid " + ... + " function..." creates temporary strings unnecessarily. Consider passing the parts as separate arguments to Status::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.

Copy link
Collaborator

@zjw1111 zjw1111 left a comment

Choose a reason for hiding this comment

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

+1

@zjw1111 zjw1111 merged commit 62b100c into alibaba:main Mar 17, 2026
11 of 12 checks passed
@mrdrivingduck mrdrivingduck deleted the refactor/move-predicate-utils-to-public-include branch March 17, 2026 09:46
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.

3 participants