drill-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j...@apache.org
Subject drill git commit: DRILL-3869: Allow queries submitted through the web UI to end with a semi-colon
Date Thu, 01 Oct 2015 21:37:38 GMT
Repository: drill
Updated Branches:
  refs/heads/master 83ebc7886 -> f01da3eeb


DRILL-3869: Allow queries submitted through the web UI to end with a semi-colon

This closes #178


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

Branch: refs/heads/master
Commit: f01da3eeb763f501aa924bbdbe4f91fe7ee454d2
Parents: 83ebc78
Author: aleph-zero <andrew@primer.org>
Authored: Thu Oct 1 11:54:09 2015 -0700
Committer: Jason Altekruse <altekrusejason@gmail.com>
Committed: Thu Oct 1 14:18:14 2015 -0700

----------------------------------------------------------------------
 .../java/org/apache/drill/exec/server/rest/QueryResources.java  | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/drill/blob/f01da3ee/exec/java-exec/src/main/java/org/apache/drill/exec/server/rest/QueryResources.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/server/rest/QueryResources.java
b/exec/java-exec/src/main/java/org/apache/drill/exec/server/rest/QueryResources.java
index 145a476..1978cd8 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/server/rest/QueryResources.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/server/rest/QueryResources.java
@@ -17,7 +17,6 @@
  */
 package org.apache.drill.exec.server.rest;
 
-import java.util.Collection;
 import java.util.List;
 import java.util.Map;
 
@@ -30,6 +29,7 @@ import javax.ws.rs.Path;
 import javax.ws.rs.Produces;
 import javax.ws.rs.core.MediaType;
 
+import com.google.common.base.CharMatcher;
 import com.google.common.collect.ImmutableList;
 import com.google.common.collect.Lists;
 import org.apache.drill.common.config.DrillConfig;
@@ -69,7 +69,8 @@ public class QueryResources {
   @Produces(MediaType.TEXT_HTML)
   public Viewable submitQuery(@FormParam("query") String query, @FormParam("queryType") String
queryType) throws Exception {
     try {
-      final QueryWrapper.QueryResult result = submitQueryJSON(new QueryWrapper(query, queryType));
+      String trimmedQueryString = CharMatcher.is(';').trimTrailingFrom(query.trim());
+      final QueryWrapper.QueryResult result = submitQueryJSON(new QueryWrapper(trimmedQueryString,
queryType));
       return new Viewable("/rest/query/result.ftl", new TabularResult(result));
     } catch(Exception | Error e) {
       logger.error("Query from Web UI Failed", e);


Mime
View raw message