我尝试了几个查询,发现一些SQL查询正在工作,而另一些则不行。
我使用dev工具上传了测试数据。我也上传了几百份文件(crwaler)。
PUT /library/book/_bulk?refresh&pretty
{"index":{"_id": "Leviathan Wakes"}}
{"name": "Leviathan Wakes", "author": "James S.A. Corey", "release_date": "2011-06-02", "page_count": 561}
{"index":{"_id": "Hyperion"}}
{"name": "Hyperion", "author": "Dan Simmons", "release_date": "1989-05-26", "page_count": 482}
{"index":{"_id": "Dune"}}
{"name": "Dune", "author": "Frank Herbert", "release_date": "1965-06-01", "page_count": 604}SHOW tables LIKE %;
.kibana_1
cwl-2021.01.05
library,
select * from .kibana_1;这项工作如预期的那样:
select * from library where page_count > 500 and name = 'Dune'select * from cwl-2021.01.05收到“无响应”错误
select * from cwl*只有当ID在前200个记录内:
时才能工作
select * from cwl* where requestID = '3FB4131539FD4403'管道查询语言仅适用于库索引。
search source=library page_count > 500 and name = 'Dune'它不适用于.kibana_1或cwl-2021.01.05等其他索引。
我不确定AWS elasticsearch实例如何支持SQL和PPL。
发布于 2021-01-07 17:15:15
对于这个用例,您总是可以使用回勾。例如:
POST /_opendistro/_ppl
{
"query": """
source=`filebeat-7.10.0-2020.11.28`
"""
}发布于 2021-01-07 16:08:12
有关使用特殊字符的标识符的分隔,请参阅此参考。
关于文件的更多内容:
Sql:https://github.com/opendistro-for-elasticsearch/sql/blob/develop/docs/user/index.rst
Ppl:https://github.com/opendistro-for-elasticsearch/sql/blob/develop/docs/experiment/ppl/index.rst
捐款:https://github.com/opendistro-for-elasticsearch/sql/blob/develop/docs/developing.rst
论坛:https://discuss.opendistrocommunity.dev/c/sql/8
Sql/ppl :都是在开放源码中开发的,并且都是在aws服务中使用的。
发布于 2021-01-07 04:40:43
这是因为SQL和PPL不喜欢表名中的点或破折号这样的特殊字符。
PUT /cwl-2021.01.06/_alias/cwl20210106
PUT /cwl-2021.01.07/_alias/cwl20210107我创建了一个别名,现在一切似乎都如期而至。
从cwl20210107选择*,其中eventID = 'xxx‘限制为100
所有的节拍、爬虫(默认情况下)在索引名中都有特殊的字符。更改索引名并不容易。:)
https://stackoverflow.com/questions/65573240
复制相似问题