Suppose we have a HIVE table like this
name id age
jones 12 34
george joseph 13 45
bush 15 23
Now i want to output this hive table to csv and pipe separated file. I followed steps in How do I output the results of a HiveQL query to CSV?.
hive -e 'select books from table' | sed 's/[[:space:]]\+/,/g' > /home/lvermeer/temp.csv
But its working this these
name id age
jones 12 34
george joseph 13 45
bush 15 23
I want george joseph to be in 1 column. Since george joseph contains middle spaces, its outputting to next column. How to resolve this problem ??