You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@calcite.apache.org by GitBox <gi...@apache.org> on 2020/02/17 08:15:22 UTC

[GitHub] [calcite] jerryleooo opened a new pull request #1813: fix elasticsearch fetch mapping

jerryleooo opened a new pull request #1813: fix elasticsearch fetch mapping
URL: https://github.com/apache/calcite/pull/1813
 
 
   Fix https://issues.apache.org/jira/browse/CALCITE-3802

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [calcite] jerryleooo commented on a change in pull request #1813: [CALCITE-3802] Fix elasticsearch fetch mapping

Posted by GitBox <gi...@apache.org>.
jerryleooo commented on a change in pull request #1813: [CALCITE-3802] Fix elasticsearch fetch mapping
URL: https://github.com/apache/calcite/pull/1813#discussion_r381052278
 
 

 ##########
 File path: elasticsearch/src/main/java/org/apache/calcite/adapter/elasticsearch/ElasticsearchTransport.java
 ##########
 @@ -118,7 +120,14 @@ private ElasticsearchVersion version() {
    * Build index mapping returning new instance of {@link ElasticsearchMapping}.
    */
   private ElasticsearchMapping fetchAndCreateMapping() {
-    final String uri = String.format(Locale.ROOT, "/%s/_mapping", indexName);
+    String encodedIndexName = indexName;
+    try {
+      encodedIndexName = URLEncoder.encode(indexName, StandardCharsets.UTF_8.toString());
+    } catch (Exception e) {
 
 Review comment:
   Good idea, will see how to implement.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [calcite] asereda-gs commented on a change in pull request #1813: fix elasticsearch fetch mapping

Posted by GitBox <gi...@apache.org>.
asereda-gs commented on a change in pull request #1813: fix elasticsearch fetch mapping
URL: https://github.com/apache/calcite/pull/1813#discussion_r380194978
 
 

 ##########
 File path: elasticsearch/src/main/java/org/apache/calcite/adapter/elasticsearch/ElasticsearchTransport.java
 ##########
 @@ -118,7 +120,14 @@ private ElasticsearchVersion version() {
    * Build index mapping returning new instance of {@link ElasticsearchMapping}.
    */
   private ElasticsearchMapping fetchAndCreateMapping() {
-    final String uri = String.format(Locale.ROOT, "/%s/_mapping", indexName);
+    String encodedIndexName = indexName;
+    try {
+      encodedIndexName = URLEncoder.encode(indexName, StandardCharsets.UTF_8.toString());
+    } catch (Exception e) {
 
 Review comment:
   Does it make sense to (re)use [URIBuilder](https://hc.apache.org/httpcomponents-client-4.3.x/httpclient/apidocs/org/apache/http/client/utils/URIBuilder.html) ?
   I think it encodes path segments automatically. 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services