You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@griffin.apache.org by "Wan Kun (Jira)" <ji...@apache.org> on 2020/02/08 08:16:00 UTC

[jira] [Resolved] (GRIFFIN-322) Add SQL mode for ES connector

     [ https://issues.apache.org/jira/browse/GRIFFIN-322?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Wan Kun resolved GRIFFIN-322.
-----------------------------
    Fix Version/s: 0.6.0
       Resolution: Fixed

Issue resolved by pull request 567
[https://github.com/apache/griffin/pull/567]

> Add SQL mode for ES connector
> -----------------------------
>
>                 Key: GRIFFIN-322
>                 URL: https://issues.apache.org/jira/browse/GRIFFIN-322
>             Project: Griffin
>          Issue Type: Improvement
>            Reporter: XIAOYU YU
>            Priority: Major
>             Fix For: 0.6.0
>
>          Time Spent: 40m
>  Remaining Estimate: 0h
>
> The ElasticSearch connector was added in Griffin. We want to enrich it by adding sql mode.
> ES SQL plugins are very popular, such as :  [https://github.com/NLPchina/elasticsearch-sql/wiki |https://github.com/NLPchina/elasticsearch-sql/wiki]and  [https://www.elastic.co/guide/en/elasticsearch/reference/7.x/xpack-sql.html].
> For example: 
> {code:java}
> curl -X POST 'http://{es_url}/_sql?format=csv'  -H 'Content-Type: application/json'  -d 'select a, b, c from {index} where a is not null limit 2'{code}
> would get csv response as follows:
>  
> {code:java}
> a,b,c
> 1,test,1.55
> 2,test,1.57{code}
>  
> So we want Griffin ES Connector could load data by ES SQL in sql mode.  In sql mode, user could config Connector for ES (with sql plugin) like: 
>  
> {{{ "type": "custom",}}
> {{  "config": {}}
> {{    "class": "org.apache.griffin.measure.datasource.connector.batch.ElasticSearchGriffinDataConnector",}}
> {{     "host": "xxxxxxx",}}
> {{     "port": "xxxx",}}
> {{     "sql": "select a, b, c from xxx where a = 2 limit 100"}}}
> {{}}}
>  
>  Which has the following benefits:
>  # For case that only part of the ES data is needed, or only aggregated result is needed, it could significantly reduce IO and improve performance by handle filter and aggregation to ES. 
>  # It is more user-friendly, since we don't need to define data size and schema. 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)