[SERVER-52963] [SBE] Add support for ExpressionMeta when _metaType == MetaType::kIndexKey Created: 20/Nov/20  Updated: 06/Dec/22

Status: Backlog
Project: Core Server
Component/s: Querying
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Martin Neupauer Assignee: Backlog - Query Execution
Resolution: Unresolved Votes: 0
Labels: qexec-team
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Assigned Teams:
Query Execution
Operating System: ALL
Steps To Reproduce:

> db.adminCommand({setParameter: 1, internalQueryEnableSlotBasedExecutionEngine: true});
> db.c1.createIndex({a:1});
> db.c1.find({a: 1}, {c: {$meta: 'indexKey'}});

 

Participants:

 Description   

A simple query with an index and $meta fails.

Right now the query from the "Steps To Reproduce" section hits an invariant failure: reqs.has(kReturnKey) || !ixn->addKeyMetadata .

I tried fixing this invariant by calling PlanStageReqs::set() at the top level to set kReturnKey, and then I re-ran the query from the "Steps To Reproduce" section. When I did this, I got the following error message: "Expression is not supported in SBE: $meta".

So it looks like we need to update "sbe_stage_builder_expression.cpp" so that it can handle ExpressionMeta with _metaType == MetaType::kIndexKey .


Generated at Thu Feb 08 05:29:31 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.