My fault, I had a greedy regular expression that was replacing the space in
the value “Basic Authentication” with nothing.

It’s working now.

Some people, when confronted with a problem, think “I know, I’ll use
regular expressions.” Now they have two problems.

Thanks guys.

Chris mattacma...@mapr.com
215-701-3146

On Mon, Jun 8, 2015 at 11:32 PM, Jim Bates <jba...@maprtech.com> wrote:

I use a DNS in a connection string like this for my pyodbc in my
> notebooks...
>
> MY_DSN = "DSN=Drill 1.0 sandbox;UID=mapr;PWD=mapr"
> conn = pyodbc.connect(MY_DSN, autocommit=True)
>
> On Mon, Jun 8, 2015 at 9:29 PM, Christopher Matta <cma...@mapr.com> wrote:
>
> > That's actually my notebook, which I'm trying to update to use with Drill
> > authentication, yes I'm using the DSN (the first argument in the connect
> > function).
> >
> > Chris Matta
> > cma...@mapr.com
> > 215-701-3146
> >
> > On Mon, Jun 8, 2015 at 10:24 PM, Matt <bsg...@gmail.com> wrote:
> >
> > > Does using a DSN as per this notebook help?
> > >
> > >
> > >
> >
> http://nbviewer.ipython.org/github/cjmatta/drill_ipython_notebook/blob/master/Twitter%20Drill%20Pandas.ipynb
> > >
> > > https://github.com/cjmatta/drill_ipython_notebook
> > >
> > >
> > >
> > > On 8 Jun 2015, at 22:20, Christopher Matta wrote:
> > >
> > >  Does anyone know what the expected key names are for userid and
> password
> > >> for an ODBC connection? I was using pyodbc to connect to Drill pre-1.0
> > but
> > >> now with authentication enabled I haven’t figured out how to do it.
> > >>
> > >> Relevant errors:
> > >>
> > >> conn =
> > >>
> >
> pyodbc.connect('Driver=/opt/mapr/drillodbc/lib/universal/libmaprdrillodbc.dylib;ConnectionType=Zookeeper;ZKQuorum=hosta:5181,hostb:5181,hostc:5181;ZKClusterID=cluster-drillbits;Catalog=DRILL;AuthenticationType=BasicAuthentication;AdvancedProperties=CastAnyToVarchar=true;HandshakeTimeout=5;QueryTimeout=180;TimestampTZDisplayTimezone=utc;ExcludedSchemas=sys,INFORMATION_SCHEMA;NumberOfPrefetchBuffers=5;uid=cmatta;pwd=xxxx',
> > >> autocommit=True)
> > >> cursor = conn.cursor()
> > >> cursor.execute('select * from maprfs.cmatta.tweets_view limit 10;')
> > >>
> > >> --- output ---
> > >>
> > >>
> >
> ---------------------------------------------------------------------------
> > >> Error Traceback (most recent call last)
> > >> <ipython-input-8-7c757991ba47> in <module>()
> > >> 1 conn =
> > >>
> >
> pyodbc.connect('Driver=/opt/mapr/drillodbc/lib/universal/libmaprdrillodbc.dylib;ConnectionType=Zookeeper;ZKQuorum=hosta:5181,hostb:5181,hostc:5181;ZKClusterID=cluster-drillbits;Catalog=DRILL;AuthenticationType=BasicAuthentication;AdvancedProperties=CastAnyToVarchar=true;HandshakeTimeout=5;QueryTimeout=180;TimestampTZDisplayTimezone=utc;ExcludedSchemas=sys,INFORMATION_SCHEMA;NumberOfPrefetchBuffers=5;uid=cmatta;pwd=xxxx',
> > >> autocommit=True)
> > >> 2 cursor = conn.cursor()
> > >> ----> 3 cursor.execute('select * from maprfs.cmatta.tweets_view limit
> > >> 10;')
> > >>
> > >> Error: ('HY000', '[HY000] [MapR][Drill] (1040) Drill failed to execute
> > >> the query: select * from maprfs.cmatta.tweets_view limit
> > >> 10;\n[30027]Query execution error. Details:[ \nSYSTEM ERROR:
> > >> java.lang.IllegalArgumentException: A valid userName is
> > >> expected\n\n\n[Error Id: 2f26217c-ddac-4195-9bfb-03c519a95e56 on
> > >> se-node12.se.lab:31010]\n] (1040) (SQLExecDirectW)')
> > >>
> > >> I’ve also tried replacing uid with user, username, userName etc… with
> no
> > >> luck.
> > >>
> > >> Chris mattacma...@mapr.com
> > >> 215-701-3146
> > >> ​
> > >>
> > >
> >
>
​

Reply via email to