metamodel-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (METAMODEL-225) Metamodel throws a UnsupportedOperationException for documents containing nested JSON in ElasticSearch
Date Thu, 21 Apr 2016 18:41:25 GMT

    [ https://issues.apache.org/jira/browse/METAMODEL-225?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15252428#comment-15252428
] 

ASF GitHub Bot commented on METAMODEL-225:
------------------------------------------

Github user kaspersorensen commented on the pull request:

    https://github.com/apache/metamodel/pull/95#issuecomment-213058448
  
    But there are a few new unittests, did you notice those? (can be hard because the diff
is towards master).


> 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)

Mime
View raw message