[
https://issues.apache.org/jira/browse/CALCITE-6386?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17986760#comment-17986760
]
Yu Xu edited comment on CALCITE-6386 at 6/29/25 2:31 AM:
---------------------------------------------------------
this issue is staled for one more year, so I assgine to myself, and the origin
pr fix way seems not right. I had added a new
pr([https://github.com/apache/calcite/pull/4449]) about it.
was (Author: JIRAUSER307770):
this issue is staled for one more year, so I assgine to myself, and thr origin
pr fix way seems not right. I had added a new
pr(https://github.com/apache/calcite/pull/4449) about it.
> Elasticsearch adapter throws NullPointerException when used with with
> model.json and no username, password or pathPrefix
> ------------------------------------------------------------------------------------------------------------------------
>
> Key: CALCITE-6386
> URL: https://issues.apache.org/jira/browse/CALCITE-6386
> Project: Calcite
> Issue Type: Bug
> Components: elasticsearch-adapter
> Affects Versions: 1.36.0
> Reporter: guluo
> Assignee: Yu Xu
> Priority: Major
> Labels: pull-request-available
>
> Reproduction steps:
> 1 Creating model.json, according to the calcite doc about [Elasticsearch
> adapter
> (apache.org)|https://calcite.apache.org/docs/elasticsearch_adapter.html]
> {
> "version": "1.0",
> "defaultSchema": "elasticsearch",
> "schemas": [
> {
> "type": "custom",
> "name": "elasticsearch",
> "factory":
> "org.apache.calcite.adapter.elasticsearch.ElasticsearchSchemaFactory",
> "operand": {
> "coordinates": "\{'127.0.0.1': 9200}"
> }
> }
> ]
> }
>
> 2 Connecting es by sqlline
> sqlline> !connect jdbc:calcite:model=/root/build/calcite//model.json
>
> 3 We would get NPE,as follow.
> Caused by: java.lang.NullPointerException: at index 1
> at
> com.google.common.collect.ObjectArrays.checkElementNotNull(ObjectArrays.java:232)
> at
> com.google.common.collect.ObjectArrays.checkElementsNotNull(ObjectArrays.java:222)
> at
> com.google.common.collect.ObjectArrays.checkElementsNotNull(ObjectArrays.java:216)
> at
> com.google.common.collect.ImmutableList.construct(ImmutableList.java:354)
> at com.google.common.collect.ImmutableList.of(ImmutableList.java:128)
> at
> org.apache.calcite.adapter.elasticsearch.ElasticsearchSchemaFactory.connect(ElasticsearchSchemaFactory.java:202)
> at
> org.apache.calcite.adapter.elasticsearch.ElasticsearchSchemaFactory.create(ElasticsearchSchemaFactory.java:176)
> at org.apache.calcite.model.ModelHandler.visit(ModelHandler.java:275)
--
This message was sent by Atlassian Jira
(v8.20.10#820010)