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
Transport exception processing BigDecimal type from groovy script #11071
Comments
@bradvido I've tried various combinations of mappings etc to replicate this problem on 1.5.2, and it all seems to work just fine. Could you add a small recreation? For some reason Groovy is converting one of those values to BigDecimal (which we don't support), but I can't see why it is doing that. I found this bug which may be related? http://jira.codehaus.org/browse/GROOVY-7238 |
I should mention I'm running ES on Windows -- maybe the bug is platform specific, Also, in Groovy, every literal number with a decimal point becomes a BigDecimal. It needs a 'd' identifier to be treated as a double. So maybe, i should change the literal |
We automatically convert BigDecimal constants to floating-point, see here: #6609 |
Hmm, then it shouldn't make a difference if i use literal decimals in my script. I'll try to find a simple way so others can reproduce this. |
Hi! I've run into a similar issue (same "Can't write type [class java.math.BigDecimal]" exception on some shards). Our groovy script had this line:
rewriting it to the following got rid of the exception:
|
@bradvido We were using ES 1.5.1 when we had this issue. How do I check what version of Groovy I have ? I'll update ES to a more recent version, but the issue was solved with the "d" postfix on constants. |
This should be fixed by #12288 - I'm going to close for now, but feel free to reopen if you see the same thing on 1.7.0 or later thaks |
Thanks. Will test on 1.7.0 |
Just hit this issue in 1.7.2. I know this is an old issue and an old version of ES, just wanted to say for future reference that changing an expression from |
I'm using ElasticSearch 1.5.2.
I have a groovy script_file
disk_total_free_percent.groovy
:When I execute a search with
script_fields
including the above script, I get an error from ES[indices:data/read/search[phase/fetch/id]]]; nested: IOException[Can't write type [class java.math.BigDecimal]];
This is generated by this line of code in StreamOutput.java
It's also interesting that the number of shards that fail with this exception varies (for the same query). Sometimes it's 1, sometimes 2 or 3.
For comparison, I installed the javascript scripting plugin and tried the same script (replacing
def
withvar
)disk_total_free_percent.js
:And it worked without any exceptions. This makes me think it's a problem with the Groovy scripting module.
The text was updated successfully, but these errors were encountered: