Skip to content

IGNITE-28374 Calcite. Fix SQL select by _key for a composite pk for key class#13225

Open
zstan wants to merge 1 commit into
apache:masterfrom
zstan:ignite-28374
Open

IGNITE-28374 Calcite. Fix SQL select by _key for a composite pk for key class#13225
zstan wants to merge 1 commit into
apache:masterfrom
zstan:ignite-28374

Conversation

@zstan

@zstan zstan commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@zstan zstan force-pushed the ignite-28374 branch 2 times, most recently from 0771724 to 6d650a7 Compare June 17, 2026 10:29
@zstan zstan requested a review from Copilot June 17, 2026 10:30

Copilot AI left a comment

Copy link
Copy Markdown

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 updates Calcite execution so SQL predicates on _key for composite primary keys work when the key is provided as a Java key class (not already a BinaryObject), and extends test coverage around composite PK key comparisons and scan selection.

Changes:

  • Add a binary marshalling hook to ExecutionContext and wire it from ExecutionServiceImpl so dynamic parameters can be converted to BinaryObject when needed.
  • Adjust IndexWrappedKeyScan to gracefully handle mismatched/invalid binary key types by skipping boundary creation (matching table-scan behavior).
  • Rework/extend Calcite integration tests for composite PK _key comparisons, ordering, and “unexpected key type” scenarios; plus minor nullability/spelling tweaks.

Reviewed changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated 11 comments.

Show a summary per file
File Description
modules/core/src/main/java/org/apache/ignite/internal/plugin/IgniteLogInfoProviderImpl.java Minor ASCII logo correction.
modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/exec/ExecutionServiceImpl.java Creates and passes a binary marshaller into execution contexts.
modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/exec/ExecutionContext.java Accepts marshaller and uses it for parameter conversion (notably _key).
modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/exec/IndexWrappedKeyScan.java Skips index boundary creation when _key binary type mismatches index key type.
modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/exec/IndexScan.java Minor comment typo fix in changed hunk.
modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/exec/ExchangeServiceImpl.java Updates ExecutionContext construction for inbox context (new ctor arg).
modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/schema/CacheTableDescriptorImpl.java Removes unnecessary checked exception from a helper.
modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/util/TypeUtils.java Adds @Nullable return annotations for internal conversions.
modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/exec/exp/IgniteSqlFunctions.java Adds @Nullable return annotations for toBigDecimal overloads.
modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/planner/PlanExecutionTest.java Updates ExecutionContext construction for new ctor arg.
modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/exec/RuntimeSortedIndexTest.java Updates ExecutionContext construction for new ctor arg.
modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/exec/rel/AbstractExecutionTest.java Updates ExecutionContext construction for new ctor arg.
modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/exec/LogicalRelImplementorTest.java Updates ExecutionContext construction for new ctor arg (currently passes null).
modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/integration/SelectByKeyFieldTest.java Large test refactor/expansion for composite PK _key behavior and forced scan types.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 14 out of 14 changed files in this pull request and generated 3 comments.

@zstan zstan force-pushed the ignite-28374 branch 2 times, most recently from f77cb69 to 239aa0a Compare June 17, 2026 12:52
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