Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
Description
Properties config = new Properties(); config.put("lex", "JAVA"); String sql = "select * from index"; try (Connection con = DriverManager.getConnection("jdbc:calcite:model=src/main/resources/es.json", config)) { try (Statement stmt = con.createStatement()) { try (ResultSet rs = stmt.executeQuery(sql)) { printRs(rs); } } }
es.json
{ "version": "1.0", "defaultSchema": "elasticsearch", "schemas": [ { "type": "custom", "name": "elasticsearch", "factory": "org.apache.calcite.adapter.elasticsearch.ElasticsearchSchemaFactory", "operand": { "coordinates": "{'192.168.133.104': 9200}", "jdbcUser": "elastic", "jdbcPassword": "elastic" } } ] }
and throw Exception
{ "error":{ "root_cause":[ { "type":"security_exception", "reason":"missing authentication token for REST request [/_alias]", "header":{ "WWW-Authenticate":"Basic realm="security" charset="UTF-8"" } } ], "type":"security_exception", "reason":"missing authentication token for REST request [/_alias]", "header":{ "WWW-Authenticate":"Basic realm="security" charset="UTF-8"" } }, "status":401 }
Where to set Elasticsearch username/password?
Attachments
Issue Links
- links to