fix: [bug] PPL query with mvindex() fails when plugins.calcite.pushdown.enabled=true (#5660) - #5689
Conversation
PR Reviewer Guide 🔍(Review updated until commit ee33606)Here are some key observations to aid the review process:
|
…hdown.enabled=true` (opensearch-project#5660) Signed-off-by: Ajimelec Gonzalez <ajimelec@amazon.com>
065908a to
ee33606
Compare
|
Persistent review updated to latest commit ee33606 |
PR Code Suggestions ✨Explore these optional code suggestions:
|
Description
Fix Calcite pushdown
CompileExceptionwhere arithmetic in array index expressions (e.g.,mvindex(entity, 1)) produceslonginstead ofintat runtime.RexStandardizerwidens arithmetic operands toBIGINTfor doc-value compatibility, butPLUSnodes do not have their type serialized inJSON(unlikeCAST/MINUS). On deserialization the type is re-derived fromBIGINToperands, breaking operators likeITEMthat expectint.Fix: Wrap arithmetic results in an explicit
CAST(INTEGER)inRexStandardizer.visitCall()when the original type is narrower thanBIGINT.CASTnodes always serialize their type, soINTEGERis preserved through serialization and deserialization.Related Issues
Resolves #5660
See also: #5670 (alternative plan-layer fix that is ineffective because the serialization layer overrides it)
Check List
--signoffor-s.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.