Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

How to write spark dataframe into existing parquet hive table

avatar

Hi,

I want to write spark dataframe into hive table.Hive table is partitioned on year and month and file format is parquet.

Currently i am writing dataframe into hive table using insertInto() and mode("append") i am able to write the data into hive table but i am not sure that is the correct way to do it? Also while writing i am getting "parquet.hadoop.codec.CompressionCodecNotSupportedException: codec not supported: org.apache.hadoop.io.compress.DefaultCodec" this exception.

Could you please help me on this?

Thanks for your time,

1 REPLY 1

avatar

@RAUI

1. Currently i am writing dataframe into hive table using insertInto() and mode("append") i am able to write the data into hive table but i am not sure that is the correct way to do it?

Please review the following link, I'm hoping it helps address this question:

https://stackoverflow.com/questions/47844808/what-are-the-differences-between-saveastable-and-insert...

2. For the exception I would suggest you open separate thread and add more information - including full error stack, spark client command line arguments and code you are running that is failing.

HTH