phoenix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Josh Elser (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (PHOENIX-2931) Phoenix client asks users to provide configs in cli that are present on the machine in hbase conf
Date Wed, 29 Jun 2016 05:51:45 GMT

    [ https://issues.apache.org/jira/browse/PHOENIX-2931?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15354600#comment-15354600
] 

Josh Elser commented on PHOENIX-2931:
-------------------------------------

Two more nits:

{code}
-    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()
+def printUsage():
+    print "\nUsage: sqlline.py [zookeeper_quorum_port] \
{code}

{{zookeeper_quorum_port}} seems inaccurate. I think the original {{zookeeper}} is better.

{code}
-if len(sys.argv) > 2:
-    sqlfile = "--run=" + phoenix_utils.shell_quote([sys.argv[2]])
+sqlfile = ""
+zookeeper = ""
 
 # HBase configuration folder path (where hbase-site.xml reside) for
 # HBase/Phoenix client side property override
 hbase_config_path = os.getenv('HBASE_CONF_DIR', phoenix_utils.current_dir)
 
+if len(sys.argv) == 2:
+    if os.path.isfile(sys.argv[1]):
+        sqlfile = sys.argv[1]
+    else:
+        zookeeper = sys.argv[1]
+
+if len(sys.argv) == 3:
+    if os.path.isfile(sys.argv[1]):
+        printUsage()
+    else:
+        zookeeper = sys.argv[1]
+        sqlfile = sys.argv[2]
+
+if sqlfile:
+    sqlfile = "--run=" + sqlfile
+
{code}

It seems like you dropped an {{phoenix_utils.shell_quote}} invocation on {{sqlfile}}.

I can fix both of these on commit if you agree, [~aliciashu].

> Phoenix client asks users to provide configs in cli that are present on the machine in
hbase conf
> -------------------------------------------------------------------------------------------------
>
>                 Key: PHOENIX-2931
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-2931
>             Project: Phoenix
>          Issue Type: Bug
>            Reporter: Alicia Ying Shu
>            Assignee: Alicia Ying Shu
>            Priority: Minor
>             Fix For: 4.9.0
>
>         Attachments: PHOENIX-2931-v1.patch, PHOENIX-2931-v2.patch, PHOENIX-2931-v3.patch,
PHOENIX-2931-v4.patch, PHOENIX-2931.patch
>
>
> Users had complaints on running commands like
> {code}
> phoenix-sqlline pre-prod-poc-2.novalocal,pre-prod-poc-10.novalocal,pre-prod-poc-1.novalocal:/hbase-unsecure
service-logs.sql
> {code}
> However the zookeeper quorum and the port are available in hbase configs. Phoenix should
read these configs from the system instead of having the user supply them every time.
> What we can do is to introduce a keyword "default". If it is specified, default zookeeper
quorum and port will be taken from hbase configs. Otherwise, users can specify their own.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message