Skip to content

[Cosmos] Align SUPPORTED_QUERY_FEATURES with .NET SDK — add ListAndSetAggregate, CountIf, HybridSearchSkipOrderByRewrite #48661

@jeet1995

Description

@jeet1995

Align SUPPORTED_QUERY_FEATURES with .NET SDK

Context

The Java SDK's QueryPlanRetriever.SUPPORTED_QUERY_FEATURES advertises 14 query features while the .NET SDK advertises 17. Three features are missing in Java:

Missing Feature .NET Status Impact
ListAndSetAggregate ✅ Sent MAKELIST/MAKESET queries get suboptimal plans
CountIf ✅ Sent Present in Java's QueryFeature enum but not included in the features string
HybridSearchSkipOrderByRewrite ✅ Sent Hybrid search uses less efficient ORDER BY plans

Current Java feature string

Aggregate, CompositeAggregate, MultipleOrderBy, MultipleAggregates, OrderBy, OffsetAndLimit,
Distinct, GroupBy, Top, DCount, NonValueAggregate, NonStreamingOrderBy, HybridSearch, WeightedRankFusion

.NET feature string (superset)

Includes all of the above plus: ListAndSetAggregate, CountIf, HybridSearchSkipOrderByRewrite

Why this matters now

PR #47759 adds RNTBD header tokens (SupportedQueryFeatures 0x00FF, QueryVersion 0x0100) to transmit the feature set to the thin client proxy. The proxy uses these to determine which query plan features to include. Customers using the missing features through thin client will get degraded (less optimal) query plans.

Suggested fix

  1. Add ListAndSetAggregate and HybridSearchSkipOrderByRewrite to QueryFeature enum (if not already present)
  2. Add CountIf to the SUPPORTED_QUERY_FEATURES string in QueryPlanRetriever (it's already in the enum but not sent)
  3. Add ListAndSetAggregate and HybridSearchSkipOrderByRewrite to the features string
  4. Validate each feature against the proxy's query engine behavior

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions