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

UncategorizedExecutionException[Failed execution]; nested: IOException[can not write type [class java.math.BigDecimal]]; #27270

Closed
mustafaakin opened this issue Nov 5, 2017 · 4 comments

Comments

@mustafaakin
Copy link

mustafaakin commented Nov 5, 2017

Elasticsearch version (bin/elasticsearch --version): 5.5

Plugins installed: []

JVM version (java -version): 1.8.0_144

OS version (uname -a if on a Unix-like system): OSX High Sierra

Description of the problem including expected versus actual behavior:

I have the following query that is sent by transport client, generated by some code, I got it from the debug mode:

{
  "size" : 0,
  "aggregations" : {
    "osman" : {
      "meta" : {
        "order" : 0
      },
      "filter" : {
        "bool" : {
          "must" : [
            {
              "range" : {
                "age" : {
                  "from" : "10",
                  "to" : null,
                  "include_lower" : false,
                  "include_upper" : true,
                  "boost" : 1.0
                }
              }
            }
          ],
          "disable_coord" : false,
          "adjust_pure_negative" : true,
          "boost" : 1.0
        }
      },
      "aggregations" : {
        "inner" : {
          "avg" : {
            "field" : "age"
          }
        }
      }
    }
  }
}

It throws the following exception:

UncategorizedExecutionException[Failed execution]; nested: IOException[can not write type [class java.math.BigDecimal]];
	at org.elasticsearch.action.support.AdapterActionFuture.rethrowExecutionException(AdapterActionFuture.java:89)
	at org.elasticsearch.action.support.AdapterActionFuture.actionGet(AdapterActionFuture.java:76)
	at org.elasticsearch.action.support.AdapterActionFuture.actionGet(AdapterActionFuture.java:63)
	at org.elasticsearch.action.ActionRequestBuilder.get(ActionRequestBuilder.java:69)

It executes nicely via the rest API in Kibana:

{
  "took": 1,
  "timed_out": false,
  "_shards": {
    "total": 5,
    "successful": 5,
    "failed": 0
  },
  "hits": {
    "total": 7,
    "max_score": 0,
    "hits": []
  },
  "aggregations": {
    "osman": {
      "meta": {
        "order": 0
      },
      "doc_count": 6,
      "inner": {
        "value": 38.166666666666664
      }
    }
  }
}
@mustafaakin
Copy link
Author

Sorry, I saw that my parser put 10 as BigDecimal, but why does it fail for bigdecimal? I suppose it is because there is no serialization for BigDecimal over the wire?

@jasontedor
Copy link
Member

That's correct, serialization of BigDecimal is not supported.

@vermarajput
Copy link

I understand that serialization of BigDecimal or LocalDate is not supported, howver, is there any work around the same??

@jasontedor
Copy link
Member

@vermarajput Please see #17006.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants