You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@metamodel.apache.org by "Kasper Sørensen (JIRA)" <ji...@apache.org> on 2016/01/01 21:01:39 UTC
[jira] [Commented] (METAMODEL-225) Metamodel throws a
UnsupportedOperationException for documents containing nested JSON in
ElasticSearch
[ https://issues.apache.org/jira/browse/METAMODEL-225?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15076370#comment-15076370 ]
Kasper Sørensen commented on METAMODEL-225:
-------------------------------------------
Good catch.
Just a clarification from my side: I guess this only happens in the (new) REST protocol elasticsearch module. The (old) native module is not affected I think.
> Metamodel throws a UnsupportedOperationException for documents containing nested JSON in ElasticSearch
> ------------------------------------------------------------------------------------------------------
>
> Key: METAMODEL-225
> URL: https://issues.apache.org/jira/browse/METAMODEL-225
> Project: Apache MetaModel
> Issue Type: Bug
> Reporter: Akash Suryawanshi
>
> I am using metamodel to connect to elastic search. I created a document in an index
> {code}
> PUT /megacorp/employee/1
> {
> "email": "john@smith.com",
> "first_name": "John",
> "last_name": "Smith",
> "info": {
> "bio": "Eco-warrior and defender of the weak",
> "age": 25,
> "interests": [ "dolphins", "whales" ]
> },
> "join_date": "2014/05/01"
> }
> {code}
> I create a DataSet and call the getRow method on it. I get the following exception
> {code}
> java.lang.UnsupportedOperationException: JsonObject
> at com.google.gson.JsonElement.getAsString(JsonElement.java:191) ~[gson-2.2.4.jar:na]
> at org.apache.metamodel.elasticsearch.rest.JestElasticSearchUtils.getDataFromColumnType(JestElasticSearchUtils.java:72) ~[MetaModel-elasticsearch-rest-4.5.0.jar:4.5.0]
> at org.apache.metamodel.elasticsearch.rest.JestElasticSearchUtils.createRow(JestElasticSearchUtils.java:50) ~[MetaModel-elasticsearch-rest-4.5.0.jar:4.5.0]
> at org.apache.metamodel.elasticsearch.rest.JestElasticSearchDataSet.getRow(JestElasticSearchDataSet.java:126) ~[MetaModel-elasticsearch-rest-4.5.0.jar:4.5.0]
> {code}
> However this exception does not occur when the document is a simple JSON i.e.. no nested JSON with any of the fields.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)