Skip to content

SQL: grouping by values resulting from fields compared with constants #34543

@astefan

Description

@astefan

At the moment something like select (3 < languages) as multi_language, count(*) from test_emp group by multi_language doesn't work. The exception is not entirely accurate in my opinion and the ES query used in this scenario is very similar with the one from #34400.

{
  "size": 0,
  "aggs": {
    "NAME": {
      "composite": {
        "sources": [
          {
            "product": {
              "terms": {
                "script": {
                  "source": "doc['languages'].value > 3",
                  "lang": "painless"
                }
              }
            }
          }
        ]
      }
    }
  }
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions