impala connection via sqlalchemy
See original GitHub issueI’m new to hadoop and impala. After many days, I’ve managed to connect to using
from impala.dbapi import connect
from impala.util import as_pandas
conn = connect(host="server.lrd..com",port=21050, database='tcad',auth_mechanism='PLAIN', user="alexcj", use_ssl=True,timeout=20, password="secret1pass")
cursor = conn.cursor()
cursor.execute('SELECT * FROM bom_2014_m LIMIT 10')
df = as_pandas(cursor)
Basically, I’m finally able to connect, query and create a dataframe from returned results.
Now, how do I connect to impala with sqlalchemy? I’ve seen
engine = create_engine('impala://localhost')
in the test files but my connection string has whole lot more parameters than the host. How do I pass all my parameters above to create_engine
? I’m designing a backend api with flask that will query from impala so this step is important. If you’re familiar with flask-sqlalchemy, I’d like to know exactly what to pass to SQLALCHEMY_DATABASE_URI . If not, I’m willing to use sqlalchemy’s declarative extension hence this question. Thanks.
Issue Analytics
- State:
- Created 7 years ago
- Comments:7
Top GitHub Comments
you may or may not need some of those parameters
Does anyone know what is needed to connect to impala if we are using Kerberos?