How to save output in any format

2016-09-06 Thread sanjivktr
I am using drill in embedded mode in window having 1.8 version. 
Suppose i have fire query :- select * from DemoSQLServer..Attribute; It will 
return some output.
Now my question is :- Is it possible to save the output ?  I know in drill 
documnet  !record  is there:- 
https://drill.apache.org/docs/configuring-the-drill-shell/
While using record it will save the output in bin folder in file format.
But I want to save the output in any format  (e.g:- csv, txt, excel, etc) and 
in any where (i.e:- in any directory or folder). OR:- Can i give file 
extension(e.g:- csv, excel, txt, etc) and directory name( e.g:- 
d://) which i want to save the output in query itself.?
Is it Possible in Drill.? or any other option is there.? 

Sent from Yahoo Mail. Get the app

Re: How to save output in any format

2016-09-06 Thread Abhishek Girish
You can specify this using the outputformat option in sqlline.

sqlline> !record ~/output.csv
sqlline> !outputformat csv

Another way I usually do is via sqlline variables and scripts.


$DRILL_HOME/bin/sqlline -u jdbc:drill:zk=: --outputformat=csv
< ~/input.sql > ~/output.csv


On Tue, Sep 6, 2016 at 12:57 AM,  wrote:

> I am using drill in embedded mode in window having 1.8 version.
> Suppose i have fire query :- select * from DemoSQLServer..Attribute; It
> will return some output.
> Now my question is :- Is it possible to save the output ?  I know in drill
> documnet  !record  is there:- https://drill.apache.
> org/docs/configuring-the-drill-shell/
> While using record it will save the output in bin folder in file format.
> But I want to save the output in any format  (e.g:- csv, txt, excel, etc)
> and in any where (i.e:- in any directory or folder). OR:- Can i give file
> extension(e.g:- csv, excel, txt, etc) and directory name( e.g:-
> d://) which i want to save the output in query itself.?
> Is it Possible in Drill.? or any other option is there.?
>
> Sent from Yahoo Mail. Get the app


Re: How to save output in any format

2016-09-06 Thread Andries Engelbrecht
You may also look at using the storage plugins to create output by using CTAS.
You then need to set the session/system to use the appropriate storage format 
(store.format).
http://drill.apache.org/docs/configuration-options-introduction/ 


However in your case it is mostly limited to delimited text formats. (No excel, 
etc)
http://drill.apache.org/docs/data-sources-and-file-formats-introduction/ 



--Andries



> On Sep 6, 2016, at 9:19 AM, Abhishek Girish  wrote:
> 
> You can specify this using the outputformat option in sqlline.
> 
> sqlline> !record ~/output.csv
> sqlline> !outputformat csv
> 
> Another way I usually do is via sqlline variables and scripts.
> 
> 
> $DRILL_HOME/bin/sqlline -u jdbc:drill:zk=: --outputformat=csv
> < ~/input.sql > ~/output.csv
> 
> 
> On Tue, Sep 6, 2016 at 12:57 AM,  wrote:
> 
>> I am using drill in embedded mode in window having 1.8 version.
>> Suppose i have fire query :- select * from DemoSQLServer..Attribute; It
>> will return some output.
>> Now my question is :- Is it possible to save the output ?  I know in drill
>> documnet  !record  is there:- https://drill.apache.
>> org/docs/configuring-the-drill-shell/
>> While using record it will save the output in bin folder in file format.
>> But I want to save the output in any format  (e.g:- csv, txt, excel, etc)
>> and in any where (i.e:- in any directory or folder). OR:- Can i give file
>> extension(e.g:- csv, excel, txt, etc) and directory name( e.g:-
>> d://) which i want to save the output in query itself.?
>> Is it Possible in Drill.? or any other option is there.?
>> 
>> Sent from Yahoo Mail. Get the app