Apache Hive Temporary Tables

A temporary table in Apache Hive, as the name indicates, is a table that works like a regular table but exists only temporarily in Hive’s temp space. It will remain till the user’s session expires. They are most often used to save interim results from batch processing that do not need to be saved permanently.

Example:
CREATE TEMPORARY TABLE tempEmp(empno INT, ename STRING, sal DOUBLE);

HiveTemporaryTables1

Looking at the above image, you can see that the temporary table is stored at /tmp/hive/user/* rather than the default Hive warehouse directory.

I hope you found this post useful. Please click the follow button to receive notifications of new postings.

One comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s