You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@drill.apache.org by Charles Givre <cg...@gmail.com> on 2015/04/21 18:41:56 UTC

Drill and Python

All,
Forgive the n00b question, but I've been trying to write a Python
script to interact with Apache Drill.  I've installed the JayDeBeAPI,
and PyODBC modules, but I've not been able to successfully connect.
(I also installed the ODBC driver).  Does anyone have working code
that establishes the connection and executes a query that you'd be
willing to share?
Thank you,
- Charles

Re: Drill and Python

Posted by Jim Bates <jb...@maprtech.com>.
I was using a macbook with an iPython notebook. Below is the info I used on
mac to set up the DSN

Here is an example config for a zookeeper connection:

[ODBC Data Sources]
Drill 0.8 sandbox = MapR Drill ODBC Driver

[Drill 0.8 sandbox]
Driver = /opt/mapr/drillodbc/lib/universal/libmaprdrillodbc.dylib
ConnectionType = Zookeeper
HOST = [HOST]
PORT = [PORT]
ZKQuorum = maprdemo:5181
ZKClusterID = demo_mapr_com-drillbits
Catalog = DRILL
AdvanacedProperties =
CastAnyToVarchar=true;HandshakeTimeout=5;QueryTimeout=180;TimestampTZDisplayTimezone=utc;ExcludedSchemas=sys,INFORMATION_SCHEMA;NumberOfPrefetchBuffers=5;

Here is an example config for a direct connection:

[ODBC Data Sources]
Drill 0.8 sandbox = MapR Drill ODBC Driver

[Drill 0.8 sandbox]
Driver = /opt/mapr/drillodbc/lib/universal/libmaprdrillodbc.dylib
ConnectionType = Direct
HOST = maprdemo
PORT = 31010
ZKQuorum =
ZKClusterID =
Catalog = DRILL
AdvanacedProperties =
CastAnyToVarchar=true;HandshakeTimeout=5;QueryTimeout=180;TimestampTZDisplayTimezone=utc;ExcludedSchemas=sys,INFORMATION_SCHEMA;NumberOfPrefetchBuffers=5;


On Tue, Apr 21, 2015 at 11:50 AM, Charles Givre <cg...@gmail.com> wrote:

> Thanks Chris.  That's exactly what I was looking for.
>
>
> On Tue, Apr 21, 2015 at 12:45 PM, Christopher Matta <cm...@mapr.com>
> wrote:
> > Charles, I have an iPyghon notebook using PyODBC:
> > https://github.com/cjmatta/drill_ipython_notebook
> >
> > On Tuesday, April 21, 2015, Charles Givre <cg...@gmail.com> wrote:
> >
> >> All,
> >> Forgive the n00b question, but I've been trying to write a Python
> >> script to interact with Apache Drill.  I've installed the JayDeBeAPI,
> >> and PyODBC modules, but I've not been able to successfully connect.
> >> (I also installed the ODBC driver).  Does anyone have working code
> >> that establishes the connection and executes a query that you'd be
> >> willing to share?
> >> Thank you,
> >> - Charles
> >>
> >
> >
> > --
> > Chris Matta
> > cmatta@mapr.com
> > 215-701-3146
>

Re: Drill and Python

Posted by Charles Givre <cg...@gmail.com>.
Thanks Chris.  That's exactly what I was looking for.


On Tue, Apr 21, 2015 at 12:45 PM, Christopher Matta <cm...@mapr.com> wrote:
> Charles, I have an iPyghon notebook using PyODBC:
> https://github.com/cjmatta/drill_ipython_notebook
>
> On Tuesday, April 21, 2015, Charles Givre <cg...@gmail.com> wrote:
>
>> All,
>> Forgive the n00b question, but I've been trying to write a Python
>> script to interact with Apache Drill.  I've installed the JayDeBeAPI,
>> and PyODBC modules, but I've not been able to successfully connect.
>> (I also installed the ODBC driver).  Does anyone have working code
>> that establishes the connection and executes a query that you'd be
>> willing to share?
>> Thank you,
>> - Charles
>>
>
>
> --
> Chris Matta
> cmatta@mapr.com
> 215-701-3146

Re: Drill and Python

Posted by Christopher Matta <cm...@mapr.com>.
Charles, I have an iPyghon notebook using PyODBC:
https://github.com/cjmatta/drill_ipython_notebook

On Tuesday, April 21, 2015, Charles Givre <cg...@gmail.com> wrote:

> All,
> Forgive the n00b question, but I've been trying to write a Python
> script to interact with Apache Drill.  I've installed the JayDeBeAPI,
> and PyODBC modules, but I've not been able to successfully connect.
> (I also installed the ODBC driver).  Does anyone have working code
> that establishes the connection and executes a query that you'd be
> willing to share?
> Thank you,
> - Charles
>


-- 
Chris Matta
cmatta@mapr.com
215-701-3146