[CALCITE-7743] RelJson cannot emit hints - #5224
Merged
Merged
Conversation
Serialize RelHint in RelJson and read the hints entry back in TableScan(RelInput) via a new RelInput.getHints(), so hints survive a JSON dump/read round trip instead of crashing the serializer.
mihaibudiu
approved these changes
Aug 26, 2026
|
Contributor
|
Removed the label LGTM to see if checks run. But it seems that checks are still being skipped, although I required all of them to be executed. |
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.



RelOptUtil.dumpPlan(..., JSON)throwsUnsupportedOperationExceptionfor any plan whoseLogicalTableScancarries hints:LogicalTableScan.explainTermsemits ahintsitem (added for the CALCITE-4581 digest fix), butRelJson.toJson(Object)has no branch forRelHint. Reading such a plan back silently dropped the hints.RelJson: serializeRelHint(name, inheritPath, list/kv options, position when not ZERO);toHint/toHintsfor reading backRelInput: newgetHints()with an empty default, so existing implementations are unaffectedRelJsonReaderreads thehintsentry;TableScan(RelInput)passes it through, so hints survive the round tripOnly
LogicalTableScanemitshintsin explain output today; otherHintablenodes put hints in their digest, which does not go throughRelJsonWriter.Test:
RelJsonTest.testHint— SQL with a table hint, dump to JSON (previously threw), read back throughRelJsonReader, assert hints round-trip.