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

后端 未结 5 1327
没有蜡笔的小新
没有蜡笔的小新 2020-12-17 23:27

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

5条回答
  •  天命终不由人
    2020-12-17 23:49

    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.

提交回复
热议问题