[SERVER-81556] Refactor QuerySettings.indexHints idl definition to always be std::vector<IndexHintSpec> Created: 29/Sep/23  Updated: 30/Sep/23

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

Type: Task Priority: Major - P3
Reporter: Denis Grebennicov Assignee: Backlog - Query Execution
Resolution: Unresolved Votes: 0
Labels: M3
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Assigned Teams:
Query Execution
Participants:

 Description   

Currently, QuerySettings are defined as:

  QuerySettings:
    description: >-
      Struct representing possible settings that may be applied to a given query.
    fields:
      indexHints:
        type:
          variant: [IndexHintSpec, array<IndexHintSpec>]
        optional: true
      queryEngineVersion:
        type: QueryEngineVersion
        optional: true

While specifying a variant provides additional flexibility to the user (they can either provide an array of index hint specs or a single object), this creates rather ugly code on the server side.

As part of this patch, we would refactor this (introduce custom serializer/deserializer methods), such that user can still specify IndexHintSpec or an array of specs, while we in code always have a vector of IndexHintSpecs.

The goal would be to define the serializer, deserializer methods as well as adding tests to ensure their correctness and adjust the breaking code, as now vector<IndexHintSpec> will be used.


Generated at Thu Feb 08 06:46:49 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.