You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@phoenix.apache.org by "Josh Elser (JIRA)" <ji...@apache.org> on 2016/12/03 22:38:58 UTC

[jira] [Updated] (PHOENIX-3517) Use argparse in sqlline-thin.py

     [ https://issues.apache.org/jira/browse/PHOENIX-3517?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Josh Elser updated PHOENIX-3517:
--------------------------------
    Attachment: PHOENIX-3517.patch

Switches things over to using argparse. Here's the usage which summarizes things pretty well. user/password are exposed which might be confusing, but it's future proofing sort of thing (not sure if we'll ever get JDBC standard auth into Phoenix directly).

{noformat}
usage: sqlline-thin.py [-h] [-u USER] [-p PASSWORD]
                       [-a {SPNEGO,BASIC,DIGEST,NONE}] [-s {PROTOBUF,JSON}]
                       [-au AUTH_USER] [-ap AUTH_PASSWORD]
                       [url] [sqlfile]

Launches the Apache Phoenix Thin Client.

positional arguments:
  url                   The URL to the Phoenix Query Server.
  sqlfile               A file of SQL commands to execute.

optional arguments:
  -h, --help            show this help message and exit
  -u USER, --user USER  Username for database authentication (unsupported).
  -p PASSWORD, --password PASSWORD
                        Password for database authentication (unsupported).
  -a {SPNEGO,BASIC,DIGEST,NONE}, --authentication {SPNEGO,BASIC,DIGEST,NONE}
                        Mechanism for HTTP authentication.
  -s {PROTOBUF,JSON}, --serialization {PROTOBUF,JSON}
                        Serialization type for HTTP API.
  -au AUTH_USER, --auth-user AUTH_USER
                        Username for HTTP authentication.
  -ap AUTH_PASSWORD, --auth-password AUTH_PASSWORD
                        Password for HTTP authentication.
{noformat}

The authentication username/password are provided by Avatica (did a trivial test with them using haproxy inbetween client<->pqs applying some auth). Serialization was previously only configurable via hbase-site.xml. Authentication is net-new exposed property (though not providing it retains the original functionality).

> Use argparse in sqlline-thin.py
> -------------------------------
>
>                 Key: PHOENIX-3517
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-3517
>             Project: Phoenix
>          Issue Type: Improvement
>            Reporter: Josh Elser
>            Assignee: Josh Elser
>             Fix For: 4.10.0
>
>         Attachments: PHOENIX-3517.patch
>
>
> sqlline-thin.py just does hand-rolled argument parsing. We can simplify the code, make better usage and validation choices, and support some extra options that we presently default to.
> Python's argparse does all of these for us.



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