Skip to content

feat(schema): scan context support set table schema#394

Open
gripleaf wants to merge 4 commits into
alibaba:mainfrom
gripleaf:feat/scan-set-schema
Open

feat(schema): scan context support set table schema#394
gripleaf wants to merge 4 commits into
alibaba:mainfrom
gripleaf:feat/scan-set-schema

Conversation

@gripleaf

@gripleaf gripleaf commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Purpose

Add ScanContextBuilder::SetTableSchema so scan operations can reuse a pre-loaded table schema instead of always loading the latest schema from table metadata.

For main branch data table scans, TableScan now parses the provided schema JSON via TableSchema::CreateFromJson(...) and skips SchemaManager::Latest(). If no schema is provided, or the scan targets a non-main branch, the existing latest-schema loading behavior is preserved.

Tests

  • cmake --build build --target paimon-core-test
  • ctest -R paimon-core-test --output-on-failure

API and Format

This change adds a public API in include/paimon/scan_context.h:

  • ScanContextBuilder& SetTableSchema(const std::string& table_schema)

No storage format or protocol changes.

Documentation

This introduces a new scan-side optimization API. Inline API documentation is added in scan_context.h.

Generative AI tooling

Generated-by: OpenAI Codex GPT-5

@gripleaf gripleaf marked this pull request as ready for review July 1, 2026 08:16
Comment thread include/paimon/scan_context.h
Comment thread src/paimon/core/table/source/table_scan.cpp
@gripleaf gripleaf force-pushed the feat/scan-set-schema branch from 590d7bd to 82d21d0 Compare July 1, 2026 13:38
lxy-9602
lxy-9602 previously approved these changes Jul 1, 2026

@lxy-9602 lxy-9602 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

+1

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