You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by ng...@apache.org on 2020/02/25 17:10:28 UTC

[hive] branch master updated: HIVE-22889: Trim trailing and leading quotes for HCatCli query processing (Ramesh Thangarajan via Naveen Gangam)

This is an automated email from the ASF dual-hosted git repository.

ngangam pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hive.git


The following commit(s) were added to refs/heads/master by this push:
     new faff15c  HIVE-22889: Trim trailing and leading quotes for HCatCli query processing (Ramesh Thangarajan via Naveen Gangam)
faff15c is described below

commit faff15cca6a5615029d3d02ca89db44938b48dbf
Author: Naveen Gangam <ng...@cloudera.com>
AuthorDate: Tue Feb 25 12:10:03 2020 -0500

    HIVE-22889: Trim trailing and leading quotes for HCatCli query processing (Ramesh Thangarajan via Naveen Gangam)
---
 .../core/src/main/java/org/apache/hive/hcatalog/cli/HCatCli.java    | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/hcatalog/core/src/main/java/org/apache/hive/hcatalog/cli/HCatCli.java b/hcatalog/core/src/main/java/org/apache/hive/hcatalog/cli/HCatCli.java
index 930e11e..1261241 100644
--- a/hcatalog/core/src/main/java/org/apache/hive/hcatalog/cli/HCatCli.java
+++ b/hcatalog/core/src/main/java/org/apache/hive/hcatalog/cli/HCatCli.java
@@ -177,8 +177,12 @@ public class HCatCli {
     // Now that the properties are in, we can instantiate SessionState.
     SessionState.start(ss);
 
-    // all done parsing, let's run stuff!
+    // remove the leading and trailing quotes. hcatalog can miss on some cases.
+    if (execString.length() > 1 && execString.startsWith("\"") && execString.endsWith("\"")) {
+      execString = execString.substring(1, execString.length() - 1);
+    }
 
+    // all done parsing, let's run stuff!
     if (execString != null) {
       sysExit(ss, processLine(execString));
     }