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

Calcite Elasticsearch adapter should encode the URI before send the request

Attach filesAttach ScreenshotAdd voteVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    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

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            Unassigned Unassigned
            jerryleooo jerryleooo

            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

                Slack

                  Issue deployment