Fixed empty index search failure#21754
Conversation
PR Reviewer Guide 🔍(Review updated until commit 9bdf702)Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Latest suggestions up to 9bdf702 Explore these optional code suggestions:
Previous suggestionsSuggestions up to commit 0266f70
Suggestions up to commit b1041be
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #21754 +/- ##
============================================
- Coverage 73.48% 73.38% -0.10%
+ Complexity 75084 75064 -20
============================================
Files 6016 6016
Lines 341072 341072
Branches 49091 49091
============================================
- Hits 250626 250286 -340
- Misses 70494 70836 +342
+ Partials 19952 19950 -2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
5477f32 to
0266f70
Compare
|
Persistent review updated to latest commit 5477f32 |
|
Persistent review updated to latest commit 0266f70 |
0266f70 to
61de9fb
Compare
Signed-off-by: Vinay Krishna Pudyodu <vinkrish.neo@gmail.com>
61de9fb to
9bdf702
Compare
|
Persistent review updated to latest commit 9bdf702 |
Description
Fixes
Schema error: No field named …when querying an index whose shard has zero parquet files. With no on-disk data, the Rust side'sinfer_schemacannot produce a schema, so any column reference in the substrait plan fails to bind.Fix: when a shard is empty, send a
MapperService-derived Arrow schema across the FFM boundary and register a zero-batchMemTableinstead of aListingTable. The plan validates and the query returns 0 rows with the correct columns. Non-empty shards are unaffected and stay on the existinginfer_schemapath.Changes
MapperServiceArrowSchema— Java helper that maps OpenSearch field types (keyword/text → Utf8, long → Int64, double → Float64, date → Timestamp, etc.) to an ArrowSchema.ShardScanInstructionHandler— encodes the schema as Arrow IPC bytes and passes them through; sends an empty buffer when no mapping exists.NativeBridge#createSessionContext— extends the FFM signature with(schema_ipc_ptr, schema_ipc_len); legacy callers pass(NULL, 0).df_create_session_context/create_session_context— when the shard'sobject_metasis empty and IPC bytes are supplied, decode viaStreamReaderand register a zero-batchMemTable; otherwise unchanged.None(always has on-disk files).Tests
MemTable→SELECTreturns 0 rows.