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

jerryleooo updated CALCITE-3802:
--------------------------------
    Fix Version/s:     (was: 1.22.0)

> Calcite Elasticsearch adapter should encode the URI before send the request
> ---------------------------------------------------------------------------
>
>                 Key: CALCITE-3802
>                 URL: https://issues.apache.org/jira/browse/CALCITE-3802
>             Project: Calcite
>          Issue Type: Bug
>          Components: elasticsearch-adapter
>    Affects Versions: 1.21.0
>            Reporter: jerryleooo
>            Priority: Major
>              Labels: pull-request-available
>         Attachments: image-2020-02-17-16-09-20-794.png
>
>   Original Estimate: 1h
>          Time Spent: 10m
>  Remaining Estimate: 50m
>
> In 
> [https://github.com/apache/calcite/blob/master/elasticsearch/src/main/java/org/apache/calcite/adapter/elasticsearch/ElasticsearchTransport.java#L121]
>  when the indexName has some special characters, the request will fail for 
> Elasticsearch server returning HTTP 400 error.
>  
> {code:java}
> val connection = DriverManager.getConnection("jdbc:calcite:") 
> val calciteConnection = connection.asInstanceOf[CalciteConnection] 
> val rootSchema = calciteConnection.getRootSchema()
> val esProperties = new util.HashMap[String, AnyRef]()
> esProperties.put("coordinates", "{'elasticsearch url': 80}") 
> rootSchema.add("es", new ElasticsearchSchemaFactory().create(rootSchema, 
> "es", esProperties))
> {code}
> !image-2020-02-17-16-09-20-794.png!
>  



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

Reply via email to