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

Romain Rigaux commented on PHOENIX-5938:
----------------------------------------

If we want to promote the SqlAlchemy driver itself and not tie too much to Hue 
(and get even more adoption for the Driver), those would be good tests:

{code}
./build/env/bin/pip install 
file:///home/romain/projects/phoenix-queryserver/python/phoenixdb


# https://docs.sqlalchemy.org/en/13/core/engines.html#sqlalchemy.create_engine
# pip install SQLAlchemy
# pip install file:///home/../phoenix-queryserver/python/phoenixdb
#
# python 
# >

from sqlalchemy import create_engine
from sqlalchemy import inspect


# 1. No auth, no impersonation
engine = create_engine('phoenix://stoty-1.stoty.root.hwx.site:8765')

# 2. No auth but use 'admin' as the actual user
engine = create_engine('phoenix://[email protected]:8765')

# 3. Auth with a Kerb ticket but use 'admin' as the actual user
engine = create_engine('phoenix://[email protected]:8765', 
connect_args={"authentication": "SPNEGO", "verify": False})

# 4. Clarify if 'tls' param is used?
# Could not see it in 
https://docs.sqlalchemy.org/en/13/core/engines.html#sqlalchemy.create_engine
engine = create_engine('phoenix://[email protected]:8765', 
connect_args={"authentication": "SPNEGO", "verify": False}, "tls": True) # or 
'tls' in connect_args instead?

inspector = inspect(engine)
inspector.get_table_names()

# > [' ', 'CATALOG', 'FUNCTION', 'LOG', 'SEQUENCE', 'STATS', 'US_POPULATION']
{code}

> Support impersonation in the python driver
> ------------------------------------------
>
>                 Key: PHOENIX-5938
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-5938
>             Project: Phoenix
>          Issue Type: New Feature
>          Components: queryserver
>    Affects Versions: queryserver-1.0.0
>            Reporter: Romain Rigaux
>            Assignee: Istvan Toth
>            Priority: Major
>
> Support impersonation via the doAs parameter in the python driver, and the 
> SqlAlchemy driver.
> For the SqlAlchemy driver, strive to make it compatible with the Hue 
> _has_impersonation_ option.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to