title: Integrating Spark SQL and Apache Drill through JDBC
body: <p>I would like to create a Spark SQL DataFrame from the results of a query performed over CSV data (on HDFS) with Apache Drill. I successfully configured Spark SQL to make it connect to Drill via JDBC:</p>
  
  <pre><code>Map&lt;String, String&gt; connectionOptions = new HashMap&lt;String, String&gt;();
  connectionOptions.put("url", args[0]);
  connectionOptions.put("dbtable", args[1]);
  connectionOptions.put("driver", "org.apache.drill.jdbc.Driver");
  
  DataFrame logs = sqlc.read().format("jdbc").options(connectionOptions).load();
  </code></pre>
  
  <p>Spark SQL performs two queries: the first one to get the schema, and the second one to retrieve the actual data:</p>
  
  <pre><code>SELECT * FROM (SELECT * FROM dfs.output.`my_view`) WHERE 1=0
  
  SELECT "field1","field2","field3" FROM (SELECT * FROM dfs.output.`my_view`)
  </code></pre>
  
  <p>The first one is successful, but in the second one Spark encloses fields within double quotes, which is something that Drill doesn't support, so the query fails.</p>
  
  <p>Did someone managed to get this integration working?</p>
  
  <p>Thank you!</p>