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

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

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

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

clintongormley opened this issue Mar 13, 2014 · 3 comments

Comments

@clintongormley
Copy link

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
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 added a commit that referenced this issue Mar 14, 2014
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
@spinscale
Copy link
Contributor

this also fails on 1.0. Should we backport this?

@uboness
Copy link
Contributor

uboness commented Mar 17, 2014

it should, yes... backported that is

jpountz added a commit that referenced this issue Mar 18, 2014
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
Copy link
Contributor

jpountz commented Mar 18, 2014

I just backported it.

mute pushed a commit to mute/elasticsearch that referenced this issue Jul 29, 2015
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
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants