Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Terms order aggregation name cannot contain a period #17600

Closed
niemyjski opened this issue Apr 7, 2016 · 8 comments
Closed

Terms order aggregation name cannot contain a period #17600

niemyjski opened this issue Apr 7, 2016 · 8 comments
Labels
:Analytics/Aggregations Aggregations >enhancement Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) team-discuss

Comments

@niemyjski
Copy link
Contributor

I'm running on 1.7.5 and the following works:

  "aggs": {
    "terms": {
      "terms": {
        "field": "stack_id",
        "size": 21,
        "order": {
          "distinct_user_raw": "desc"
        }
      },
      "aggs": {
        "distinct_user_raw": {
          "cardinality": {
            "field": "user.raw",
            "precision_threshold": 100
          }
        }
      }
    }
  }

however the following throws an error:

  "aggs": {
    "terms": {
      "terms": {
        "field": "stack_id",
        "size": 21,
        "order": {
          "distinct_user.raw": "desc"
        }
      },
      "aggs": {
        "distinct_user.raw": {
          "cardinality": {
            "field": "user.raw",
            "precision_threshold": 100
          }
        }
      }
    }
  }

with the error:

{
   "error": "SearchPhaseExecutionException[Failed to execute phase [query], all shards failed; shardFailures {[vsKZW_avSS6E_Ci72eNoFg][events-v1-201604][0]: AggregationExecutionException[Invalid term-aggregator order path [distinct_user.raw]. Unknown aggregation [distinct_user]]}{[vsKZW_avSS6E_Ci72eNoFg][events-v1-201604][1]: AggregationExecutionException[Invalid term-aggregator order path [distinct_user.raw]. Unknown aggregation [distinct_user]]}{[vsKZW_avSS6E_Ci72eNoFg][events-v1-201604][2]: AggregationExecutionException[Invalid term-aggregator order path [distinct_user.raw]. Unknown aggregation [distinct_user]]}{[vsKZW_avSS6E_Ci72eNoFg][events-v1-201604][3]: AggregationExecutionException[Invalid term-aggregator order path [distinct_user.raw]. Unknown aggregation [distinct_user]]}{[vsKZW_avSS6E_Ci72eNoFg][events-v1-201604][4]: AggregationExecutionException[Invalid term-aggregator order path [distinct_user.raw]. Unknown aggregation [distinct_user]]}{[vsKZW_avSS6E_Ci72eNoFg][events-v1-201604][5]: AggregationExecutionException[Invalid term-aggregator order path [distinct_user.raw]. Unknown aggregation [distinct_user]]}{[vsKZW_avSS6E_Ci72eNoFg][events-v1-201604][6]: AggregationExecutionException[Invalid term-aggregator order path [distinct_user.raw]. Unknown aggregation [distinct_user]]}{[vsKZW_avSS6E_Ci72eNoFg][events-v1-201604][7]: AggregationExecutionException[Invalid term-aggregator order path [distinct_user.raw]. Unknown aggregation [distinct_user]]}{[vsKZW_avSS6E_Ci72eNoFg][events-v1-201604][8]: AggregationExecutionException[Invalid term-aggregator order path [distinct_user.raw]. Unknown aggregation [distinct_user]]}{[vsKZW_avSS6E_Ci72eNoFg][events-v1-201604][9]: AggregationExecutionException[Invalid term-aggregator order path [distinct_user.raw]. Unknown aggregation [distinct_user]]}]",
   "status": 500
}

Please note that if I remove the order part it works.

@clintongormley
Copy link

Yes. Don't do that :)

I tried out the bucket path syntax (eg using [bar.baz]._count) but that isn't supported here. Perhaps we should.

@niemyjski
Copy link
Contributor Author

The fact that you can have aggregations with periods but not sort by it seems like a bug. On a side note I changed my code to remove the periods. But it should be all or nothing (you can sort by it, or aggregation names should be allowed to have a .)

@jpountz
Copy link
Contributor

jpountz commented Apr 8, 2016

Related to #9059.

@markharwood
Copy link
Contributor

Revisiting after some time - still fails on master.

cc @elastic/es-search-aggs

@markharwood
Copy link
Contributor

Related issue concerning dots in agg names: #19040

polyfractal added a commit to polyfractal/elasticsearch that referenced this issue Jun 20, 2018
Dots in aggregation names can lead to tricky parsing situations, like
being unable to sort by agg names with dots.

This adds a deprecation logger and a note in the docs, letting us
remove them in 8.0.

Related to elastic#17600 and elastic#19040
@rjernst rjernst added the Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) label May 4, 2020
@polyfractal
Copy link
Contributor

This is, tragically, still an issue. It's not blocked on anything that I'm aware of though, so removing the stalled.

@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-analytics-geo (Team:Analytics)

@wchaparro
Copy link
Member

Closing as not planned.

@wchaparro wchaparro closed this as not planned Won't fix, can't repro, duplicate, stale Feb 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Analytics/Aggregations Aggregations >enhancement Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) team-discuss
Projects
None yet
Development

No branches or pull requests

9 participants