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

Scripts in aggs can't return more than 4 values #5414

Closed
clintongormley opened this Issue Mar 13, 2014 · 3 comments

Comments

Projects
None yet
4 participants
@clintongormley
Member

clintongormley commented Mar 13, 2014

Document scripts can return an array of up to 4 values, but more than 4 cause an array out of bounds exception to be thrown:

DELETE /myindex
PUT /myindex/t/1
{}

GET /myindex/_search
{
  "aggs": {
    "foo": {
      "date_histogram": {
        "script": "[1388534400000,1388534400000,1388534400000,1388534400000]",
        "interval": "hour"
      }
    }
  }
}

This throws an exception:

GET /myindex/_search
{
  "aggs": {
    "foo": {
      "date_histogram": {
        "script": "[1388534400000,1388534400000,1388534400000,1388534400000,1388534400000]",
        "interval": "hour"
      }
    }
  }
}

jpountz added a commit to jpountz/elasticsearch that referenced this issue Mar 13, 2014

Allow scripts to return more than 4 values in aggregations.
A missing call to ArrayUtil.grow prevented the array that stores the values
from growing in case the number of values returned by the script was higher
than the original size of the array.

Close elastic#5414

@jpountz jpountz closed this in b7de1be Mar 14, 2014

jpountz added a commit that referenced this issue Mar 14, 2014

Allow scripts to return more than 4 values in aggregations.
A missing call to ArrayUtil.grow prevented the array that stores the values
from growing in case the number of values returned by the script was higher
than the original size of the array.

Close #5414

@jpountz jpountz added v1.1.0 labels Mar 14, 2014

@spinscale

This comment has been minimized.

Show comment
Hide comment
@spinscale

spinscale Mar 17, 2014

Member

this also fails on 1.0. Should we backport this?

Member

spinscale commented Mar 17, 2014

this also fails on 1.0. Should we backport this?

@uboness

This comment has been minimized.

Show comment
Hide comment
@uboness

uboness Mar 17, 2014

Contributor

it should, yes... backported that is

Contributor

uboness commented Mar 17, 2014

it should, yes... backported that is

jpountz added a commit that referenced this issue Mar 18, 2014

Allow scripts to return more than 4 values in aggregations.
A missing call to ArrayUtil.grow prevented the array that stores the values
from growing in case the number of values returned by the script was higher
than the original size of the array.

Close #5414

@jpountz jpountz added the v1.0.2 label Mar 18, 2014

@jpountz

This comment has been minimized.

Show comment
Hide comment
@jpountz

jpountz Mar 18, 2014

Contributor

I just backported it.

Contributor

jpountz commented Mar 18, 2014

I just backported it.

mute pushed a commit to mute/elasticsearch that referenced this issue Jul 29, 2015

Allow scripts to return more than 4 values in aggregations.
A missing call to ArrayUtil.grow prevented the array that stores the values
from growing in case the number of values returned by the script was higher
than the original size of the array.

Close elastic#5414
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment