[
https://issues.apache.org/jira/browse/PHOENIX-2931?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15348393#comment-15348393
]
Josh Elser commented on PHOENIX-2931:
-------------------------------------
{noformat}
-if len(sys.argv) < 2:
- 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"
+def printUsage():
+ print "\nUsage: sqlline.py $[zookeeper_quorum_port] \
+$[optional_sql_file] \nExample: \n 1. sqlline.py \n \
+2. sqlline.py localhost:2181:/hbase \n 3. sqlline.py \
+localhost:2181:/hbase ../examples/stock_symbol.sql \n \
+4. sqlline.py ../examples/stock_symbol.sql"
sys.exit()
{noformat}
1. I would prefer {{sqlline.py \[zookeeper_quorum_port\]
\[optional_sql_file\]}}. I've never see the {{$\[name\]}} notation to indicate
an optional argument.
2. Nit: there are better ways to create multi-line strings:
http://stackoverflow.com/questions/10660435/pythonic-way-to-create-a-long-multi-line-string
3. Nit: provide an argument to {{sys.exit()}} so that the return code isn't
{{0}}. This was an abnormal exit of the script.
{noformat}
List<String> argList = Lists.newArrayList(cmdLine.getArgList());
if (argList.isEmpty()) {
- usageError("Connection string to HBase must be supplied",
options);
+ usageError("At least one input file must be supplied",
options);
}
{noformat}
This documentation is wrong now, isn't it? The usage says only one file is
accepted.
> 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)