[CALCITE-5974] Elasticsearch adapter throws ClassCastException when index mapping sets dynamic_templates without properties#3406
Conversation
@zoov-w thank you for opening this PR, but please read the contribution rules before you do this |
e10f0ae to
964e56a
Compare
|
@jiefei30 Thanks, I pushed PR again according to contribution rules. |
|
Hi @zoov-w ,don't begin with fix to the title of a JIRA, should describe the problem behavior. BTW, you could rebase the latest code of main branch,the commits and files changed will be back to normal. |
964e56a to
2c8c6ae
Compare
2c8c6ae to
a6b794e
Compare
|
@LakeShen Thanks, I changed JIRA title and commits. |
cabb6b4 to
88ad480
Compare
…n es index set dynamic_templates without properties
ef4c033 to
9372109
Compare
|
Kudos, SonarCloud Quality Gate passed! |
elasticsearch/src/main/java/org/apache/calcite/adapter/elasticsearch/ElasticsearchJson.java
Show resolved
Hide resolved
| Map<String, String> result = new HashMap<>(); | ||
| ElasticsearchJson.visitMappingProperties(mapping, result::put); | ||
|
|
||
| assertThat(result.isEmpty(), is(true)); |
There was a problem hiding this comment.
The logic of this assertThat check isn't obvious,could you explain it in more code comment?
…ndex mapping sets dynamic_templates without properties Close apache#3406









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)
this pr fix it.