All,
I'm trying to write some python code to interact with Drill and I'm getting
a strange error.  I'm able to connect, and the SQL query is valid, but the
query does not execute.  I tried the query via the web interface, and it
worked...I've tried googling and not really gotten anywhere.  I'm running
Drill 1.0.0.  Any help would be greatly appreciated.
Thanks,
-Charles


import pyodbc
import pandas as pd

MY_DSN =
"DRIVER=/opt/mapr/drillodbc/lib/universal/libmaprdrillodbc.dylib;Host=localhost;Port=31010;ConnectionType=Direct;Catalog=Drill;Schema=mfs.views;AuthenticationType=No
Authentication"
conn = pyodbc.connect(MY_DSN, autocommit=True)

employee_query = """SELECT position_title, COUNT( employee_id ) as
employee_count
FROM cp.`employee.json`
GROUP BY position_title
ORDER BY COUNT( employee_id ) DESC"""

data = pd.read_sql( employee_query, conn )


Error: ('HY000', '[HY000] [MapR][Drill] (1040) Drill failed to execute
the query: 
������������������������������\U000a0074�����������\U000a0060������������\n\n[30027]Query
execution error. Details:[ \nPARSE ERROR: Lexical error at line 1,
column 1.  Encoun (1040) (SQLExecDirectW)')

During handling of the above exception, another exception occurred:



DatabaseError: Execution failed on sql 'SELECT position_title, COUNT(
employee_id ) as employee_count
FROM cp.`employee.json`
GROUP BY position_title
': ('HY000', '[HY000] [MapR][Drill] (1040) Drill failed to execute the
query: 
������������������������������\U000a0074�����������\U000a0060������������\n\n[30027]Query
execution error. Details:[ \nPARSE ERROR: Lexical error at line 1,
column 1.  Encoun (1040) (SQLExecDirectW)')

Reply via email to