IGNITE-28374 Calcite. Fix SQL select by _key for a composite pk for key class#13225
Open
zstan wants to merge 1 commit into
Open
IGNITE-28374 Calcite. Fix SQL select by _key for a composite pk for key class#13225zstan wants to merge 1 commit into
zstan wants to merge 1 commit into
Conversation
0771724 to
6d650a7
Compare
There was a problem hiding this comment.
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
ExecutionContextand wire it fromExecutionServiceImplso dynamic parameters can be converted toBinaryObjectwhen needed. - Adjust
IndexWrappedKeyScanto gracefully handle mismatched/invalid binary key types by skipping boundary creation (matching table-scan behavior). - Rework/extend Calcite integration tests for composite PK
_keycomparisons, 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.
f77cb69 to
239aa0a
Compare
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.
No description provided.