This looks like a bug. Could you try adding another key "userConfig": "{}" under "operand" in your model file and see if that runs? -- Michael Mior mm...@apache.org
Le lun. 4 févr. 2019 à 14:29, Allan Keers <allan.ke...@isentia.com> a écrit : > > Hi there, > I can connect my Calcite installation to the sample csv and query the tables. > When I try to connect to Elasticsearch I get the following error. > Any help would be appreciated. > Thanks, > Allan Keers > > > sqlline version 1.6.0 > > sqlline> !connect > jdbc:calcite:model=/Users/Administrator/dev/calcite/elasticsearch/elasticsearch.json > admin admin > > java.lang.RuntimeException: Error instantiating > JsonCustomSchema(name=elasticsearch) > > at org.apache.calcite.model.ModelHandler.visit(ModelHandler.java:287) > > at org.apache.calcite.model.JsonCustomSchema.accept(JsonCustomSchema.java:45) > > at org.apache.calcite.model.ModelHandler.visit(ModelHandler.java:208) > > at org.apache.calcite.model.ModelHandler.<init>(ModelHandler.java:100) > > at org.apache.calcite.jdbc.Driver$1.onConnectionInit(Driver.java:104) > > at > org.apache.calcite.avatica.UnregisteredDriver.connect(UnregisteredDriver.java:139) > > at sqlline.DatabaseConnection.connect(DatabaseConnection.java:130) > > at sqlline.DatabaseConnection.getConnection(DatabaseConnection.java:179) > > at sqlline.Commands.connect(Commands.java:1247) > > at sqlline.Commands.connect(Commands.java:1139) > > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) > > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) > > at java.lang.reflect.Method.invoke(Method.java:498) > > at sqlline.ReflectiveCommandHandler.execute(ReflectiveCommandHandler.java:38) > > at sqlline.SqlLine.dispatch(SqlLine.java:722) > > at sqlline.SqlLine.begin(SqlLine.java:540) > > at sqlline.SqlLine.start(SqlLine.java:264) > > at sqlline.SqlLine.main(SqlLine.java:195) > > Caused by: java.lang.NullPointerException > > at com.fasterxml.jackson.core.JsonFactory.createParser(JsonFactory.java:889) > > at > com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3023) > > at > org.apache.calcite.adapter.elasticsearch.ElasticsearchSchemaFactory.create(ElasticsearchSchemaFactory.java:65) > > at org.apache.calcite.model.ModelHandler.visit(ModelHandler.java:282) > > ... 18 more > > > I'm running on Macbook Pro Mac OS Mojave 10.14.1 > Elasticsearch version: > { > "name": "i-xxxxxxxxxxxx", > "cluster_name": "prod-xxxxx", > "cluster_uuid": "r2G1fHbtQO6a3ft_JLbLcg", > "version": { > "number": "5.6.8", > "build_hash": "688ecce", > "build_date": "2018-02-16T16:46:30.010Z", > "build_snapshot": false, > "lucene_version": "6.6.1" > }, > "tagline": "You Know, for Search" > } > > elasticsearch.json: > { > "version": "1.0", > "defaultSchema": "elasticsearch", > "schemas": [ > { > "type": "custom", > "name": "elasticsearch", > "factory": > "org.apache.calcite.adapter.elasticsearch.ElasticsearchSchemaFactory", > "operand": { > "coordinates": "{'99.99.99.99': 80}", > "index": "mp_mediaitems_v220190116" > } > } > ] > } >