[ 
https://issues.apache.org/jira/browse/CALCITE-5974?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

zhaowang updated CALCITE-5974:
------------------------------
    Description: 
When use es-adapter, we config a es cluster, it will fetchMapping during 
initialization.

If a index set dynamic_templates bug no mappings like this:

 
{code:java}
{
  "test_index" : {
    "mappings" : {
      "dynamic_templates" : [
        {
          "integers" : {
            "match_mapping_type" : "long",
            "mapping" : {
              "type" : "integer"
            }
          }
        }
      ]
    }
  }
} {code}
 

 

org.apache.calcite.adapter.elasticsearch.ElasticsearchJson#visitMappingProperties
 throw exception:

 
{code:java}
java.lang.ClassCastException: com.fasterxml.jackson.databind.node.ArrayNode 
cannot be cast to com.fasterxml.jackson.databind.node.ObjectNode
at 
org.apache.calcite.adapter.elasticsearch.ElasticsearchJson.visitMappingProperties(ElasticsearchJson.java:133)
  {code}
So ElasticsearchTransport initialize failed, all index of this es cluster 
access failed.

 

  was:
when use es-adapter, A index set dynamic_templates bug no mappings causing 
exceptions:

java.lang.ClassCastException: com.fasterxml.jackson.databind.node.ArrayNode 
cannot be cast to com.fasterxml.jackson.databind.node.ObjectNode
at 
org.apache.calcite.adapter.elasticsearch.ElasticsearchJson.visitMappingProperties(ElasticsearchJson.java:133)

 


> Es index mapping set dynamic_templates without properties causing bug
> ---------------------------------------------------------------------
>
>                 Key: CALCITE-5974
>                 URL: https://issues.apache.org/jira/browse/CALCITE-5974
>             Project: Calcite
>          Issue Type: Bug
>    Affects Versions: 1.35.0
>            Reporter: zhaowang
>            Priority: Major
>
> When use es-adapter, we config a es cluster, it will fetchMapping during 
> initialization.
> If a index set dynamic_templates bug no mappings like this:
>  
> {code:java}
> {
>   "test_index" : {
>     "mappings" : {
>       "dynamic_templates" : [
>         {
>           "integers" : {
>             "match_mapping_type" : "long",
>             "mapping" : {
>               "type" : "integer"
>             }
>           }
>         }
>       ]
>     }
>   }
> } {code}
>  
>  
> org.apache.calcite.adapter.elasticsearch.ElasticsearchJson#visitMappingProperties
>  throw exception:
>  
> {code:java}
> java.lang.ClassCastException: com.fasterxml.jackson.databind.node.ArrayNode 
> cannot be cast to com.fasterxml.jackson.databind.node.ObjectNode
> at 
> org.apache.calcite.adapter.elasticsearch.ElasticsearchJson.visitMappingProperties(ElasticsearchJson.java:133)
>   {code}
> So ElasticsearchTransport initialize failed, all index of this es cluster 
> access failed.
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to