You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
If OpenSearch composite aggregation's missing_bucket is true, null bucket will be included. But user can't control missing_bucket's position in result. Currently, if order is asc, missing bucket is at first ASC NULLS FIRST, if oder is desc, missing bucket is at last DESC NULLS LAST.
In SQL, user could use NULLS FIRST/NULLS LAST to set null value's position regardless order. for example, result is ordered by gender in DESC order, null values are at last. SELECT gender, avg(age) FROM accounts GROUP BY gender ORDER BY gender DESC NULLS LAST
Without support missing_bucket's position, OpenSearch SQL can not optimize SQL query when user use ASC NULLS_LAST/DESC NULLS_FIRST. More detail in here.
Describe the solution you'd like
Add new parameter missing_order in composite aggregation. Accepted order are _first and _last. Compatible with field sort parameter.
Is your feature request related to a problem? Please describe.
If OpenSearch composite aggregation's
missing_bucket
is true, null bucket will be included. But user can't control missing_bucket's position in result. Currently, if order isasc
, missing bucket is at firstASC NULLS FIRST
, if oder isdesc
, missing bucket is at lastDESC NULLS LAST
.In SQL, user could use NULLS FIRST/NULLS LAST to set null value's position regardless order. for example, result is ordered by gender in DESC order, null values are at last.
SELECT gender, avg(age) FROM accounts GROUP BY gender ORDER BY gender DESC NULLS LAST
Without support missing_bucket's position, OpenSearch SQL can not optimize SQL query when user use
ASC NULLS_LAST/DESC NULLS_FIRST
. More detail in here.Describe the solution you'd like
Add new parameter
missing_order
in composite aggregation. Accepted order are_first
and_last
. Compatible with field sort parameter.Similar feature in Elasticsearch https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-bucket-composite-aggregation.html#_missing_bucket
Describe alternatives you've considered
We could also consider compatible with Elasticsearch missing_order parameter. For example,
Additional context
Add any other context or screenshots about the feature request here.
The text was updated successfully, but these errors were encountered: