You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@phoenix.apache.org by gr...@apache.org on 2015/04/19 21:27:03 UTC

phoenix git commit: PHOENIX-1733: sqlline.py doesn't allow connecting with a tenant-specific connection

Repository: phoenix
Updated Branches:
  refs/heads/4.x-HBase-0.98 2e7c647f6 -> 299c30436


PHOENIX-1733: sqlline.py doesn't allow connecting with a tenant-specific connection

Signed-off-by: Gabriel Reid <ga...@ngdata.com>


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

Branch: refs/heads/4.x-HBase-0.98
Commit: 299c30436886cc3bb12fc141dd3c9403fcbcd937
Parents: 2e7c647
Author: Abhishek Sreenivasa <as...@salesforce.com>
Authored: Thu Apr 16 12:57:26 2015 -0700
Committer: Gabriel Reid <ga...@ngdata.com>
Committed: Sun Apr 19 21:26:50 2015 +0200

----------------------------------------------------------------------
 bin/phoenix_utils.py | 16 +++++++++++++++-
 bin/psql.py          |  6 +-----
 bin/sqlline.py       |  4 ++--
 3 files changed, 18 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/phoenix/blob/299c3043/bin/phoenix_utils.py
----------------------------------------------------------------------
diff --git a/bin/phoenix_utils.py b/bin/phoenix_utils.py
index 182cdf3..7ef8d96 100755
--- a/bin/phoenix_utils.py
+++ b/bin/phoenix_utils.py
@@ -20,7 +20,6 @@
 ############################################################################
 
 import os
-import sys
 import fnmatch
 
 def find(pattern, classPaths):
@@ -95,3 +94,18 @@ def setPath():
      testjar = find(PHOENIX_TESTS_JAR_PATTERN, phoenix_class_path)
 
  return ""
+
+def shell_quote(args):
+    """
+    Return the platform specific shell quoted string. Handles Windows and *nix platforms.
+
+    :param args: array of shell arguments
+    :return: shell quoted string
+    """
+    if os.name == 'nt':
+        import subprocess
+        return subprocess.list2cmdline(args)
+    else:
+        # pipes module isn't available on Windows
+        import pipes
+        return " ".join([pipes.quote(v) for v in args])
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/phoenix/blob/299c3043/bin/psql.py
----------------------------------------------------------------------
diff --git a/bin/psql.py b/bin/psql.py
index 247001a..5b26dcd 100755
--- a/bin/psql.py
+++ b/bin/psql.py
@@ -26,11 +26,7 @@ import phoenix_utils
 
 phoenix_utils.setPath()
 
-if os.name == 'nt':
-    args = subprocess.list2cmdline(sys.argv[1:])
-else:
-    import pipes    # pipes module isn't available on Windows
-    args = " ".join([pipes.quote(v) for v in sys.argv[1:]])
+args = phoenix_utils.shell_quote(sys.argv[1:])
 
 # HBase configuration folder path (where hbase-site.xml reside) for
 # HBase/Phoenix client side property override

http://git-wip-us.apache.org/repos/asf/phoenix/blob/299c3043/bin/sqlline.py
----------------------------------------------------------------------
diff --git a/bin/sqlline.py b/bin/sqlline.py
index f48e527..2b2750a 100755
--- a/bin/sqlline.py
+++ b/bin/sqlline.py
@@ -46,7 +46,7 @@ localhost:2181:/hbase ../examples/stock_symbol.sql"
 sqlfile = ""
 
 if len(sys.argv) > 2:
-    sqlfile = "--run=" + sys.argv[2]
+    sqlfile = "--run=" + phoenix_utils.shell_quote([sys.argv[2]])
 
 colorSetting = "true"
 # disable color setting for windows OS
@@ -57,7 +57,7 @@ java_cmd = 'java -cp "' + phoenix_utils.hbase_conf_path + os.pathsep + phoenix_u
     '" -Dlog4j.configuration=file:' + \
     os.path.join(phoenix_utils.current_dir, "log4j.properties") + \
     " sqlline.SqlLine -d org.apache.phoenix.jdbc.PhoenixDriver \
--u jdbc:phoenix:" + sys.argv[1] + \
+-u jdbc:phoenix:" + phoenix_utils.shell_quote([sys.argv[1]]) + \
     " -n none -p none --color=" + colorSetting + " --fastConnect=false --verbose=true \
 --isolation=TRANSACTION_READ_COMMITTED " + sqlfile