CTAS (Create Table As) is the way to get a CSV output. Make sure you point to 
the correct directory and storage plugin configuration. 

Also to the best way to ensure you get the CSV output file is set the session 
setting for output to CSV.

I.e. alter session set `store.format` = ‘csv’;

As an FYI, to spool or record the output of a sqlline session you can use -- 
!record /tmp/test.out    (Where you need to specific the local file system path 
and file name)
To stop recording the output simple enter !record again.

This however will just output to file the screen output and not in a specific 
file format.


—Andries


On Feb 8, 2015, at 12:27 PM, Aditya <[email protected]> wrote:

> Please see
> https://cwiki.apache.org/confluence/display/DRILL/CREATE+TABLE+AS+%28CTAS%29+Command
> 
> On Sun, Feb 8, 2015 at 10:47 AM, Minnow Noir <[email protected]> wrote:
> 
>> I'm trying to extract query results as CSV for ingestion into another
>> tool.  There's no obvious way in sqlline, the web UI, or the docs to
>> extract query results as CSV (or other formats).
>> 
>> sqlline ./test.sql > output.csv doesn't work. Is there a way to pass
>> sqlline a query file and then dump the output?
>> 
>> Thanks
>> 

Reply via email to