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.

Custom basename for HDFS part files

Custom basename for HDFS part files

Explorer

Hello

 

When we do an INSERT INTO a table in Hive - it creates multiple part files.

 

e.g. part-r-*****   or (in my case) 000000_0, 000001_0 etc.

 

I would like to have custom names for the part files (000000_0 etc). Is it possible to control the basename of these files in Hive query?

 

I have tried the below. But, it is not working (especially when reducer is set to 0).

 

set mapreduce.output.basename='part';

 

Any help/pointers is much appreciaated. Thanks.

2 REPLIES 2

Re: Custom basename for HDFS part files

Guru
There is no easy way, you might need to create some custom class, see here:

https://wiki.apache.org/hadoop/FAQ#How_do_I_change_final_output_file_name_with_the_desired_name_rath...

Re: Custom basename for HDFS part files

Explorer
How is that it differs from part- to 000000_0? I will be happy with part- instead of 00000n_0 format. Any way to change between them?