You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@phoenix.apache.org by je...@apache.org on 2014/04/12 01:15:41 UTC
git commit: PHOENIX-920: SqlLine shows funky characters when running
on Windows
Repository: incubator-phoenix
Updated Branches:
refs/heads/master 46d1c60c3 -> d6a096f07
PHOENIX-920: SqlLine shows funky characters when running on Windows
Project: http://git-wip-us.apache.org/repos/asf/incubator-phoenix/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-phoenix/commit/d6a096f0
Tree: http://git-wip-us.apache.org/repos/asf/incubator-phoenix/tree/d6a096f0
Diff: http://git-wip-us.apache.org/repos/asf/incubator-phoenix/diff/d6a096f0
Branch: refs/heads/master
Commit: d6a096f07458abd51a5772a1d9c3cd180d2011b0
Parents: 46d1c60
Author: Jeffrey Zhong <jz...@JZhongs-MacBook-Pro.local>
Authored: Fri Apr 11 16:20:03 2014 -0700
Committer: Jeffrey Zhong <jz...@JZhongs-MacBook-Pro.local>
Committed: Fri Apr 11 16:20:03 2014 -0700
----------------------------------------------------------------------
bin/psql.py | 3 +++
bin/sqlline.py | 16 ++++++++++++----
2 files changed, 15 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-phoenix/blob/d6a096f0/bin/psql.py
----------------------------------------------------------------------
diff --git a/bin/psql.py b/bin/psql.py
index f4ea018..fb688a3 100755
--- a/bin/psql.py
+++ b/bin/psql.py
@@ -30,6 +30,9 @@ phoenix_jar_path = os.getenv('PHOENIX_LIB_DIR',
"target"))
phoenix_client_jar = phoenix_utils.find("phoenix-*-client.jar", phoenix_jar_path)
+if phoenix_client_jar == "":
+ phoenix_client_jar = phoenix_utils.find("phoenix-*-client.jar", os.path.join(current_dir, ".."))
+
# HBase configuration folder path (where hbase-site.xml reside) for
# HBase/Phoenix client side property override
java_cmd = 'java -cp ".' + os.pathsep + current_dir + os.pathsep + phoenix_client_jar + \
http://git-wip-us.apache.org/repos/asf/incubator-phoenix/blob/d6a096f0/bin/sqlline.py
----------------------------------------------------------------------
diff --git a/bin/sqlline.py b/bin/sqlline.py
index 7e995fb..f5cf5ab 100755
--- a/bin/sqlline.py
+++ b/bin/sqlline.py
@@ -30,10 +30,13 @@ phoenix_jar_path = os.getenv('PHOENIX_LIB_DIR',
"target"))
phoenix_client_jar = phoenix_utils.find("phoenix-*-client.jar", phoenix_jar_path)
+if phoenix_client_jar == "":
+ phoenix_client_jar = phoenix_utils.find("phoenix-*-client.jar", os.path.join(current_dir, ".."))
+
if len(sys.argv) < 2:
- print "Zookeeper not specified. \nUsage: sqlline.sh <zookeeper> \
-<optional_sql_file> \nExample: \n 1. sqlline.sh localhost \n 2. sqlline.sh \
-localhost ../examples/stock_symbol.sql"
+ print "Zookeeper not specified. \nUsage: sqlline.py <zookeeper> \
+<optional_sql_file> \nExample: \n 1. sqlline.py localhost:2181:/hbase \n 2. sqlline.py \
+localhost:2181:/hbase ../examples/stock_symbol.sql"
sys.exit()
sqlfile = ""
@@ -41,12 +44,17 @@ sqlfile = ""
if len(sys.argv) > 2:
sqlfile = "--run=" + sys.argv[2]
+colorSetting = "true"
+# disable color setting for windows OS
+if os.name == 'nt':
+ colorSetting = "false"
+
java_cmd = 'java -cp ".' + os.pathsep + phoenix_client_jar + \
'" -Dlog4j.configuration=file:' + \
os.path.join(current_dir, "log4j.properties") + \
" sqlline.SqlLine -d org.apache.phoenix.jdbc.PhoenixDriver \
-u jdbc:phoenix:" + sys.argv[1] + \
- " -n none -p none --color=true --fastConnect=false --verbose=true \
+ " -n none -p none --color=" + colorSetting + " --fastConnect=false --verbose=true \
--isolation=TRANSACTION_READ_COMMITTED " + sqlfile
subprocess.call(java_cmd, shell=True)