beeline - export csv

The command to export csv without some useless output is:

beeline -u jdbc:hive2://localhost:10000/default --silent=true --outputformat=csv2 -e "select * from sample_07 limit 10" > out.csv

kerberosParts that can be left out if already used -u. as follows:

beeline -e "select * from sample_07 limit 10" > out.csv

If there is still some useless output, you can use to seddelete the first N lines:

sed -i '1,6d' out.csv

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324939433&siteId=291194637