How to express the scheme(https) in the model.json file, this is for connection to Elasticsearch?
The following is the model.js file:
{
"version": "1.0",
"defaultSchema": "elasticsearch",
"schemas": [
{
"type": "custom",
"name": "elasticsearch",
"factory": "org.apache.calcite.adapter.elasticsearch.ElasticsearchSchemaFactory",
"operand": {
"coordinates": "{'127.0.0.1': 9200}",
"index": "myIndex",
"useConig": "{}"
}
}
]
}
In the following JAVA code I am trying to connect to Elasticsearch:
Connection conn = DriverManager.getConnection("jdbc:calcite:", properties);
calciteConnection = conn.unwrap(CalciteConnection.class);
String elasticSchema = Resources.toString(somefile.class.getResource("/model.json"), Charset.defaultCharset());
new ModelHandler(calciteConnection, "inline:" + elasticSchema);
String sql = “select field1 from table1”
statement2 = calciteConnection.prepareStatement(sql);
ResultSet set = statement2.executeQuery();
The get a connection closed exception and I can see in the log that it was trying to connect to http not https(desired). Where do I mention https in the model file?