So, just that I'm on the same page as you, when you invoke the Java application yourself, it works fine, but when you use sqlline-thin.py, the extra argument is dropped?

If so, that just sounds like a bug in sqlline-thin.py that we could fix...

If you're skilled in Python (or even just adventurous), I'd guess it would be a relatively simple fix :)

Michael Young wrote:
Hi Josh,

you are right, the TenantId property does get passed through when I run
the command by hand (see below).

Phoenix Version: phoenix-4.7.0.2.5.0.0-1245

java $PHOENIX_OPTS \
-cp $CLASSPATH \
-Dlog4j.configuration=file:/usr/hdp/2.5.0.0-1245/phoenix/bin/log4j.properties
\
org.apache.phoenix.queryserver.client.SqllineWrapper \
-d org.apache.phoenix.queryserver.client.Driver \
-u
"jdbc:phoenix:thin:url=http://pqs1.mydomain.com:8765;serialization=PROTOBUF;TenantId=myTenant";
\
-n none -p none --color=true --fastConnect=false --verbose=true
--incremental=false --isolation=TRANSACTION_READ_COMMITTED

However, with Phoenix version 4.7.0.2.5.0.0-1245 (which comes with HDP
2.5), the python script doesn't pass any property along.   Here's the
obfuscated output when I connect to PQS:

[prompt]$ /usr/hdp/2.5.0.0-1245/phoenix/bin/sqlline-thin.py
http://pqs1.mydomain.com:8765;TenantId=myTenant

Setting property: [incremental, false]
Setting property: [isolation, TRANSACTION_READ_COMMITTED]
issuing: !connect
jdbc:phoenix:thin:url=http://pqs1.mydomain:8765;serialization=PROTOBUF
none none org.apache.phoenix.queryserver.client.Driver
Connecting to
jdbc:phoenix:thin:url=http://pqs1.mydomain:8765;serialization=PROTOBUF
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in
[jar:file:/usr/hdp/2.5.0.0-1245/phoenix/phoenix-4.7.0.2.5.0.0-1245-thin-client.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in
[jar:file:/usr/hdp/2.5.0.0-1245/hadoop/lib/slf4j-log4j12-1.7.10.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an
explanation.
SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory]
Connected to: Apache Phoenix (version unknown version)
Driver: Phoenix Remote JDBC Driver (version unknown version)
Autocommit status: true
Transaction isolation: TRANSACTION_READ_COMMITTED
Building list of tables and columns for tab-completion (set fastconnect
to true to skip)...
7603/7603 (100%) Done
Done
sqlline version 1.1.8
0: jdbc:phoenix:thin:url=http://pqs1.mydomain> !list
1 active connection:
  #0  open
jdbc:phoenix:thin:url=http://pqs1.mydomain:8765;serialization=PROTOBUF


Is this something that has changed in newer versions of Phoenix?

On Mon, Feb 20, 2017 at 1:47 PM, Josh Elser <els...@apache.org
<mailto:els...@apache.org>> wrote:

    See
    
https://github.com/apache/calcite/blob/5181563f9f26d1533a7d98ecca8443077e7b7efa/avatica/core/src/main/java/org/apache/calcite/avatica/remote/Service.java#L1759-L1768
    
<https://github.com/apache/calcite/blob/5181563f9f26d1533a7d98ecca8443077e7b7efa/avatica/core/src/main/java/org/apache/calcite/avatica/remote/Service.java#L1759-L1768>

    This should be passed down just fine. If you can provide details as
    to how it isn't, that'd be great.


    Josh Elser wrote:

        I thought arbitrary properties would be passed through, but I'm
        not sure
        off the top of my head anymore....

        Would have to dig through the Avatica JDBC driver to (re)figure
        this one
        out.

        Michael Young wrote:

            Is it possible to pass the TenantID attribute on the URL
            when using the
            phoenix query server? For example,

            /usr/hdp/2.5.0.0-1245/phoenix/bin/sqlline-thin.py
            http://pqshost.myhost.com:8765;TenantId=tenant1

            This works fine for me when connecting via jdbc. Just didn't
            seem to
            work with the query server.

            Thanks,
            -Michael




Reply via email to