SQLAlchemy URI for Presto Database with LDAP authentication
- Dominant language
- Python
- Stars
- 1.7k
- Forks
- 545
- PR merge metrics
- No merged PRs in 30d
Description
I would like to know what the SQLAlchemy URI is to connect to presto db with ldap authentication enabled.
I have tried :
````
engine = create_engine('presto://username:password@hostname:8443',connect_args={'auth':'LDAP'})
logs = Table('catalog.mytable', MetaData(bind=engine), autoload=True)
````
However I get a python stacktrace like this
````
Traceback (most recent call last):
File "", line 1, in
File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/sql/schema.py", line 439, in __new__
metadata._remove_table(name, schema)
File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/util/langhelpers.py", line 66, in __exit__
compat.reraise(exc_type, exc_value, exc_tb)
File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/sql/schema.py", line 434, in __new__
table._init(name, metadata, *args, **kw)
File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/sql/schema.py", line 514, in _init
include_columns, _extend_on=_extend_on)
File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/sql/schema.py", line 540, in _autoload
_extend_on=_extend_on
File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 2045, in run_callable
return conn.run_callable(callable_, *args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1534, in run_callable
return callable_(self, *args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/default.py", line 372, in reflecttable
table, include_columns, exclude_columns, **opts)
File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/reflection.py", line 598, in reflecttable
table_name, schema, **table.dialect_kwargs):
File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/reflection.py", line 369, in get_columns
**kw)
File "/usr/local/lib/python2.7/dist-packages/pyhive/sqlalchemy_presto.py", line 143, in get_columns
rows = self._get_table_columns(connection, table_name, schema)
File "/usr/local/lib/python2.7/dist-packages/pyhive/sqlalchemy_presto.py", line 116, in _get_table_columns
return connection.execute('SHOW COLUMNS FROM {}'.format(full_table))
File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 939, in execute
return self._execute_text(object, multiparams, params)
File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1097, in _execute_text
statement, parameters
File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1121, in _execute_context
None, None)
File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1402, in _handle_dbapi_exception
exc_info
File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/util/compat.py", line 203, in raise_from_cause
reraise(type(exception), exception, tb=exc_tb, cause=cause)
File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1116, in _execute_context
context = constructor(dialect, self, conn, *args)
File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/default.py", line 699, in _init_statement
self.cursor = self.create_cursor()
File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/default.py", line 821, in create_cursor
return self._dbapi_connection.cursor()
File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/pool.py", line 926, in cursor
return self.connection.cursor(*args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/pyhive/presto.py", line 67, in cursor
return Cursor(*self._args, **self._kwargs)
sqlalchemy.exc.StatementError: (exceptions.TypeError) __init__() got an unexpected keyword argument 'auth' [SQL: u'SHOW COLUMNS FROM "catalog.mytable"']
````
I have tried with 8080 port as well. It didn't help.
I just need the URI with the right parameters for connecting to presto using pyhive, if not sqlalchemy engine to an LDAP authentication based deployment of presto.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.