Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

How do to show query results as tab delimited in hive

Highlighted

How do to show query results as tab delimited in hive

Explorer

HI,

I am planning to run select queries saves in .sql file. I wanted to run those queries in hive and 

wanted to show results of my select queries as tab delimited rather default "|" . Please let me know what is the way to show query results as tab delimited in hive.

2 REPLIES 2
Highlighted

Re: How do to show query results as tab delimited in hive

Master Collaborator

@Hive_SQL The solution here is to create a hive table of New Format (|).   Next Select/Insert Old Format(/t) into New Format.

 

For example: select * from old_format INSERT INTO new_format

 


 


If this answer resolves your issue or allows you to move forward, please choose to ACCEPT this solution and close this topic. If you have further dialogue on this topic please comment here or feel free to private message me. If you have new questions related to your Use Case please create separate topic and feel free to tag me in your post.  


 


Thanks,



Steven

Re: How do to show query results as tab delimited in hive

Explorer

It will create a new table but the requirement is to show the results of SQL in tab delimited. If we create a now table as \t delimited and then again select * from that new format table , wouldn't it will show with default "|" delimited.

Don't have an account?
Coming from Hortonworks? Activate your account here