Skip to main content
Wilber
Gold ⭐️
Aug 12, 2020 2:22 AM UTC
Solved

Writing parquet file to hdfs for internal Hive table

I'm trying to overwrite a parquet file in hdfs for a Hive table, but I noticed a bunch of individual parquet files with unique names like this, 

table_directory /part-00199-edf111ef-0f7a-43ab-9393-8fc620195d4c-c000.snappy.parquet

 

How do I add a parquet file to a Hive table directory that's composed of several parquet file?

 

 

stevenmatison
Platinum ⭐️⭐️
Aug 12, 2020 1:49 PM UTC

@Wilber My suggestion would be to not over write existing files, but write to staging location as external table.  Then merge staging location data into final internal hive table with INSERT INTO final_table SELECT * FROM staging_table;

3 replies

stevenmatison
Platinum ⭐️⭐️
Aug 12, 2020 1:49 PM UTC

@Wilber My suggestion would be to not over write existing files, but write to staging location as external table.  Then merge staging location data into final internal hive table with INSERT INTO final_table SELECT * FROM staging_table;

Translate
Wilber
WilberAuthor
Gold ⭐️
Aug 14, 2020 1:31 AM UTC

@stevenmatison  - perfect; works! Thank you.

Translate
stevenmatison
Platinum ⭐️⭐️
Aug 14, 2020 12:55 PM UTC

Please accept the solution as answer.  Doin this helps complete the solution.

Translate