Uploaded image for project: 'Calcite'
  1. Calcite
  2. CALCITE-3802

Calcite Elasticsearch adapter should encode the URI before send the request

    XMLWordPrintableJSON

Details

    Description

      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.

       

      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))
      

       

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              jerryleooo jerryleooo
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:

                Time Tracking

                  Estimated:
                  Original Estimate - 1h
                  1h
                  Remaining:
                  Time Spent - 10m Remaining Estimate - 50m
                  50m
                  Logged:
                  Time Spent - 10m Remaining Estimate - 50m
                  10m