RE: question on output hive table to file

2012-09-05 Thread Tony Burton
a zhang [mailto:zuo...@gmail.com] Sent: 07 August 2012 05:58 To: user@hive.apache.org Subject: Re: question on output hive table to file Thanks so much! that did work. I have 200+ columns so it is quite an ugly thing. No shortcut? On Mon, Aug 6, 2012 at 9:50 PM, Vinod Singh mailto:vi...

Re: question on output hive table to file

2012-08-07 Thread Gabi D
haven't tried this but - since your myoutputtable table is tab delimited, and if this format suites your needs, you could create it as an external table and specify its hadoop path then run the getmerge command off of that location (without needing the 'insert overwrite directory ...' command, so

Re: question on output hive table to file

2012-08-06 Thread Vinod Singh
If output file is not too big then ^A can be replaced by using simple command like- $ tr "\001" "," < src_file > out_file Thanks, Vinod On Tue, Aug 7, 2012 at 10:27 AM, zuohua zhang wrote: > Thanks so much! that did work. I have 200+ columns so it is quite > an ugly thing. No shortcut?

Re: question on output hive table to file

2012-08-06 Thread zuohua zhang
Thanks so much! that did work. I have 200+ columns so it is quite an ugly thing. No shortcut? On Mon, Aug 6, 2012 at 9:50 PM, Vinod Singh wrote: > Change the query to something like- > > INSERT OVERWRITE DIRECTORY '/outputable.txt' > select concat(col1, ',', col2, ',', col3) from myoutp

Re: question on output hive table to file

2012-08-06 Thread Vinod Singh
Change the query to something like- INSERT OVERWRITE DIRECTORY '/outputable.txt' select concat(col1, ',', col2, ',', col3) from myoutputtable; That way columns will be separated by ,. Thanks, Vinod On Tue, Aug 7, 2012 at 10:16 AM, zuohua zhang wrote: > I used the following that it won't help

Re: question on output hive table to file

2012-08-06 Thread zuohua zhang
I used the following that it won't help? ROW FORMAT DELIMITED FIELDS TERMINATED BY '\t' On Mon, Aug 6, 2012 at 9:43 PM, Vinod Singh wrote: > Columns of a Hive table are separated by ^A character. Instead of doing a > "SELECT * ", you may like to use concat function to have a separator of > your

Re: question on output hive table to file

2012-08-06 Thread Vinod Singh
Columns of a Hive table are separated by ^A character. Instead of doing a "SELECT * ", you may like to use concat function to have a separator of your choice. Thanks, Vinod On Tue, Aug 7, 2012 at 9:39 AM, zuohua zhang wrote: > I have used the following to output a hive table to a file: > DROP T

question on output hive table to file

2012-08-06 Thread zuohua zhang
I have used the following to output a hive table to a file: DROP TABLE IF EXISTS myoutputable; CREATE TABLE myoutputtable ROW FORMAT DELIMITED FIELDS TERMINATED BY '\t' STORED AS TEXTFILE AS select * from originaltable; INSERT OVERWRITE DIRECTORY '/outputable.txt' select * from myoutputtable; then