Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Write Drill query output to csv (or some other format)

Tags:

apache-drill

I'm using drill in embedded mode, and I can't figure out how to save query output other than copy and pasting it.

like image 635
Kevin Avatar asked Jun 23 '15 23:06

Kevin


1 Answers

If you're using sqlline, you can create a new table as CSV as follows:

use dfs.tmp; 
alter session set `store.format`='csv';
create table dfs.tmp.my_output as select * from cp.`employee.json`;

Your CSV file(s) will appear in /tmp/my_output.

like image 153
Vince Gonzalez Avatar answered Sep 24 '22 23:09

Vince Gonzalez