I think the ODBC driver encapsulates the original query in a LIMIT 0 query to determine the types of the columns returned by the query. Drill does not have a prepare phase for the query so the ODBC driver does this to mimic the behavior of prepare.
Your real problem is that the query is crashing. Do you have access to the server logs? Can you find the error in the server log and provide the stack trace? My guess would be that this is a bug in Drill's JDBC storage plugin. On Wed, Aug 24, 2016 at 1:15 PM, Christopher Altman <[email protected]> wrote: > I am: > * Using an ODBC connector to Apache Drill > * Drill is connected to a MySQL server > * The SQL Statement (passing through ODBC) is "SELECT count(*) from > mysql.test.acme_sales" > > Within the Drill Profiles section is see that my query was mapped to: > "SELECT * FROM (SELECT count(*) from mysql.test.acme_sales ) T LIMIT 0” > > Which return an error "SYSTEM ERROR: NullPointerException” > > > My question is, why is Drill adding the “T LIMIT 0”? > > If I change it to “T LIMIT 1” in the Query tab I get valid results. > > Maybe I am missing a larger picture here, but I cannot get my SQL commands > to successfully pass through ODBC and execute on MySQL. > > Thank you for your help! > > Chris > > > >
