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

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

As an initial observation, the scripts struggle with finding out Hadoop and 
HBase configuration values (aside: maybe this is a sign to try to centralize on 
something in Bigtop to push downstream packagers to also use?). I think Alicia 
and I have tried to tackle a couple of these types of improvements in the 
recent past. I think using some "standard" environment variables have at least 
pushed us in a good direction (e.g. set "HBASE_CONF_DIR" to point at a specific 
config).

That said, I think better argument parsing is a logical follow-on. 
Positional-based argument parsing kind of has this ambiguity that I think is 
turning your nose up, James (but don't let me put words in your mouth). Would 
something like this be an improvement over what Alicia suggested?

{{./sqlline.py --zookeepers zk1,zk2,zk3:2181:/hbase-whatever --file input.sql}}

I think Sergey did a decent job at outlining how we could make this backwards 
compatible too. Let me do the same for my own sake :)

1. {{sqlline.py arg}}, if the argument is a file, extract ZooKeepers from the 
HBase configuration, else throw an error
2. {{sqlline.py arg arg}}, if the second argument isn't a file, throw an error 
(standard parsing now)
3. {{sqlline.py}}, extract ZooKeepers from the HBase configuration (lets the 
shell handle any redirected input)

IMO, if we're going to make a change to how argument parsing works for 
clarity's sake, why not do it in such a way that doesn't rely on positional 
arguments to prevent us from hitting this problem in another $x months?

> 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
>         Attachments: 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)

Reply via email to