You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by jc...@apache.org on 2017/05/04 09:12:52 UTC

hive git commit: HIVE-16576: Fix encoding of intervals when fetching select query candidates from druid (Nishant Bangarwa, reviewed by Jesus Camacho Rodriguez)

Repository: hive
Updated Branches:
  refs/heads/master d769f35fb -> f56abb405


HIVE-16576: Fix encoding of intervals when fetching select query candidates from druid (Nishant Bangarwa, reviewed by Jesus Camacho Rodriguez)


Project: http://git-wip-us.apache.org/repos/asf/hive/repo
Commit: http://git-wip-us.apache.org/repos/asf/hive/commit/f56abb40
Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/f56abb40
Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/f56abb40

Branch: refs/heads/master
Commit: f56abb4054cbc4ba8c8511596117f7823d60dbe6
Parents: d769f35
Author: Nishant Bangarwa <ni...@gmail.com>
Authored: Thu May 4 09:33:35 2017 +0100
Committer: Jesus Camacho Rodriguez <jc...@apache.org>
Committed: Thu May 4 09:35:10 2017 +0100

----------------------------------------------------------------------
 .../apache/hadoop/hive/druid/io/DruidQueryBasedInputFormat.java   | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hive/blob/f56abb40/druid-handler/src/java/org/apache/hadoop/hive/druid/io/DruidQueryBasedInputFormat.java
----------------------------------------------------------------------
diff --git a/druid-handler/src/java/org/apache/hadoop/hive/druid/io/DruidQueryBasedInputFormat.java b/druid-handler/src/java/org/apache/hadoop/hive/druid/io/DruidQueryBasedInputFormat.java
index fe6c901..53624e1 100644
--- a/druid-handler/src/java/org/apache/hadoop/hive/druid/io/DruidQueryBasedInputFormat.java
+++ b/druid-handler/src/java/org/apache/hadoop/hive/druid/io/DruidQueryBasedInputFormat.java
@@ -20,6 +20,7 @@ package org.apache.hadoop.hive.druid.io;
 import java.io.IOException;
 import java.io.InputStream;
 import java.net.URL;
+import java.net.URLEncoder;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.HashMap;
@@ -213,7 +214,7 @@ public class DruidQueryBasedInputFormat extends InputFormat<NullWritable, DruidW
             StringUtils.join(query.getIntervals(), ","); // Comma-separated intervals without brackets
     final String request = String.format(
             "http://%s/druid/v2/datasources/%s/candidates?intervals=%s",
-            address, query.getDataSource().getNames().get(0), intervals);
+            address, query.getDataSource().getNames().get(0), URLEncoder.encode(intervals, "UTF-8"));
     final InputStream response;
     try {
       response = DruidStorageHandlerUtils.submitRequest(client, new Request(HttpMethod.GET, new URL(request)));