Set the UID and PWD properties in the connection string. http://tshiran.github.io/drill/docs/odbc-configuration-reference/ has a first draft of the docs that include a description of the properties. Some of these docs, esp Linux and windows installation, are incomplete.
On Monday, June 8, 2015, Christopher Matta <[email protected]> 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 [email protected] <javascript:;> > 215-701-3146 > > -- Kristine Hahn Sr. Technical Writer 415-497-8107 @krishahn
