Coerce MemTable schema to fix Binary/BinaryView mismatch on reduce sink - #21910
Conversation
…ry/BinaryView mismatch on reduce sink Signed-off-by: Vinay Krishna Pudyodu <vinkrish.neo@gmail.com>
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #21910 +/- ##
============================================
- Coverage 73.51% 73.50% -0.01%
+ Complexity 75582 75573 -9
============================================
Files 6034 6034
Lines 342661 342661
Branches 49294 49294
============================================
- Hits 251918 251885 -33
- Misses 70712 70753 +41
+ Partials 20031 20023 -8 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
…ry/BinaryView mismatch on reduce sink (opensearch-project#21910) Signed-off-by: Vinay Krishna Pudyodu <vinkrish.neo@gmail.com>
Description
Fixes a Substrait
Binaryvs MemTableBinaryViewtype-mismatch on the reduce-sink path. Cross-index queries (JOIN, IN-subquery) over parquet-backed indices withiporbinaryfields fail at plan-binding time with:Root cause
derive_schema_from_partial_plan(inanalytics-backend-datafusion/rust/src/api.rs) builds a throwaway MemTable to bind named-table refs in the substrait wire plan. It appliestransform_schema_to_view(flipsBinary→BinaryView) but never appliesschema_coerce::coerce_inferred_schemato the MemTable schema beforefrom_substrait_plan. The substrait consumer then sees wireBinaryagainst MemTableBinaryViewand rejects the binding.PR #21631 introduced the coercer for the table-scan path
Fix
One-line addition: apply
coerce_inferred_schemato the MemTable schema aftertransform_schema_to_viewandcoerce_unsupported_timestamp_precision. The MemTable now lands in the sameBinary/Int64/Float32shape as the wire.Verification
Verified locally against mch2's 2-shard QA branch (cherry-picked
qa: default analytics-engine datasets to 2 shards+ un-mute commits). Across 5 suites named in mch2's failure report bucket #1 (Binary/IP, 170 units):Residual failures all attributable to other report buckets (unimplemented scalar functions, RexCall casts, decimal divide, etc.) — none introduced by this change.
Related Issues
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.