In order to retrieve a query plan for non streaming order by queries, the sdk must send NonStreamingOrderBy in the list of supported query features to the gateway. However, older gateways will not recognize this new value, causing the query plan request to fail with a 400. To mitigate this edge case, we add a check for an environment variable AZURE_COSMOS_NON_STREAMING_ORDER_BY_FLAG_DISABLED, which when set to True will suppress sending NonStreamingOrderBy in the list of supported query features.
A note about the naming
It is named as DISABLED by design for two reasons:
Since we decided to have this functionality enabled by default, if the environment variable is set, then the functionality would be disabled. This is reflected in the name of the environment variable.
The convention is always to have false be the default for boolean flags. (Since C# will auto initialize to false for members.) If we name the flag as ENABLED, the default value would have to be true
Type of change
[x] Bug fix (non-breaking change which fixes an issue)
Description
In order to retrieve a query plan for non streaming order by queries, the sdk must send NonStreamingOrderBy in the list of supported query features to the gateway. However, older gateways will not recognize this new value, causing the query plan request to fail with a 400. To mitigate this edge case, we add a check for an environment variable
AZURE_COSMOS_NON_STREAMING_ORDER_BY_FLAG_DISABLED
, which when set toTrue
will suppress sending NonStreamingOrderBy in the list of supported query features.A note about the naming It is named as
DISABLED
by design for two reasons:false
be the default for boolean flags. (Since C# will auto initialize to false for members.) If we name the flag asENABLED
, the default value would have to betrue
Type of change