Dremio with python

Can anyone help me Connecting python with dremio on linux machine .I want to know where to install that Pyodbc package and where to set that hostname and all. pls help

Hi,

We have some documentation that should cover your questions here. That covers installing and connecting on Linux using our pyodbc driver. If you have trouble with any of the steps, please ask here and we can help you further.

Hi Doron,
Thanks for the quick reply .I installed Dremio Linux ODBC driver want to know how to use the Pyodbc package and where to addd those properties enlisted inside document.

And Can I use PYODBC package in Zeppelin Notebook ??

@abhba,

You’ll have to install pyodbc on you local machine: https://pypi.org/project/pyodbc/

Then you can import the pyodbc library to your Zeppelin Python notebook. Here’s Zeppelin’s documentation on integrating with the Python interpreter.

https://zeppelin.apache.org/docs/latest/interpreter/python.html

I tried with jdbc in zeppelin notebook with the below connection string but getting parse error .

%jdbc(dremio)
import jaydebeapi

conn = jaydebeapi.connect(“com.dremio.jdbc.Driver”,
“jdbc:dremio:direct=xx.xx.xx.xx:31010”,
[“xxxxxxxx”, “xxxxxxx”],
‘/usr/hdp/current/zeppelin-server/lib/dremio-jdbc-driver-3.1.9-201904051346520183-a35b753.jar’,)
curs = conn.cursor()
curs.execute(“show databases”)
curs.fetchall()
error:
java.sql.SQLException: PARSE ERROR: Failure parsing the query.

SQL Query import jaydebeapi

conn = jaydebeapi.connect(“com.dremio.jdbc.Driver”,
“jdbc:dremio:direct=xx.xx.xx.xx:31010”,
[“xxxxxxx”, “xxxxxxx”],
‘/usr/hdp/current/zeppelin-server/lib/dremio-jdbc-driver-3.1.9-201904051346520183-a35b753.jar’,)
curs = conn.cursor()
curs.execute(“show databases”)
curs.fetchall()
startLine 1
startColumn 1
endLine 1
endColumn 6
SQL Query import jaydebeapi

Dremio does not have a show databases SQL command. To see look view catalog entities in Dremio, try querying Dremio’s system tables: https://docs.dremio.com/advanced-administration/querying-metadata.html

You can also use the tables method of the cursor object to access metadata information: https://github.com/mkleehammer/pyodbc/wiki/Cursor.

This alternative method is only available when using pyodbc though

Hi ben,
I beg to differ from you I can show you that dremio does have show databases command I tried in Zeppelin only .

My apologies @abhba; you are correct.

Does this mean you were able to query Dremio successfully from Zeppelin?

@abhba I edited your post to remove some of your connection information. Please be careful when posting.

Yes ben .But when I m trying to connect with python .Then I am getting parse error message.

Hi laurent,
Thank you so much for doing that .and for the next time I will take care of it.

As for the original question, this thread has been tracking it: Connecting dremio with python using jdbc