Skip to content

[FEATURE] Support nested sub-aggregation parser #4338

@LantaoJin

Description

@LantaoJin

Is your feature request related to a problem?
DSL https://github.com/opensearch-project/opensearch-benchmark-workloads/blob/main/big5/queries/range-auto-date-histo-with-metrics.json

{
  "size": 0,
  "aggs": {
    "tmax": {
      "range": {
        "field": "metrics.size",
        "ranges": [
          {
            "to": -10
          },
          {
            "from": -10,
            "to": 10
          },
          {
            "from": 10,
            "to": 100
          },
          {
            "from": 100,
            "to": 1000
          },
          {
            "from": 1000,
            "to": 2000
          },
          {
            "from": 2000
          }
        ]
      },
      "aggs": {
        "date": {
          "auto_date_histogram": {
            "field": "@timestamp",
            "buckets": 20
          },
          "aggs": {
            "tmin": {
              "min": {
                "field": "metrics.tmin"
              }
            },
            "tavg": {
              "avg": {
                "field": "metrics.size"
              }
            },
            "tmax": {
              "max": {
                "field": "metrics.size"
              }
            }
          }
        }
      }
    }
  }
}

requests a nested sub-aggregation parser to manipulate the pattern such as

{
  "size": 0,
  "aggs": {
    ...,
      "aggs": {
        ...,
          "aggs": {
            ...
          }
        }
      }
    }
  }
}

#4210 is to resolve the auto_date_histogram aggregation and #4201 is to resolve the range aggregation. But they cannot work together since we miss a nested sub-aggregation parser.

What solution would you like?
Composite aggregation only support terms, histogram, date-histogram, geotile_grid. For other aggregations, we have to support them via support nested sub-aggregation parser which is to manipulate

{
  "size": 0,
  "aggs": {
    ...,
      "aggs": {
        ...,
          "aggs": {
            ...
          }
        }
      }
    }
  }
}

What alternatives have you considered?
Fail with exception.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or requestpushdownpushdown related issues

Type

No type
No fields configured for issues without a type.

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions