Elasticsearch 6.3 X-PACK SQL Overview,
Elasticsearch 6.3 X-PACK SQL Overview
Elasticsearch SQL aims to provide a powerful yet lightweight SQL interface to Elasticsearch
写在前面
However the backing engine itself is Elasticsearch for which Elasticsearch SQL was purposely created hence why features or concepts that are not available, or cannot be mapped correctly, in SQL appear in Elasticsearch SQL. Last but not least, Elasticsearch SQL tries to obey the principle of least suprise, though as all things in the world, everything is relative.
Elasticsearch终究是Elasticsearch,不能够完全兼容SQL。开发者们尽量准守principle of least suprise(最小惊吓原则)来开发Elasticsearch SQL。
Overview
X-PACK SQL支持以REST API、SQL CLI客户端以及JDBC的形式连接Elasticsearch。
Mapping concepts across SQL and Elasticsearch
| SQL | Elasticsearch |
|---|---|
| column | field |
| row | document |
| table | index |
| schema | implicit |
| database | cluster |
SQL REST API
支持txt,json,yaml,smile,cbor,csv
SQL Translate API
将SQL语句转换为Elasticsearch查询语法
POST /_xpack/sql/translate
{
"query": "SELECT * FROM library ORDER BY page_count DESC",
"fetch_size": 10
}
SQL CLI
$ ./bin/elasticsearch-sql-cli https://some.server:9200
SQL JDBC
这部分未进一步探索,因为这个功能是收费的
<dependency>
<groupId>org.elasticsearch.plugin</groupId>
<artifactId>jdbc</artifactId>
<version>6.3.2</version>
</dependency>
存在的问题
Reference
SQL Access
本站文章为和通数据库网友分享或者投稿,欢迎任何形式的转载,但请务必注明出处.
同时文章内容如有侵犯了您的权益,请联系QQ:970679559,我们会在尽快处理。