Support Questions

Find answers, ask questions, and share your expertise
Announcements
Check out our newest addition to the community, the Cloudera Data Analytics (CDA) group hub.

Hive: Temporary table created automatically

Rising Star

For Hive table of type TEXTFILE, a temporary table gets automatically created like below (for each table that we create), at the time when you try to do an INSERT. Can you please advise if this is an expected behavior and the temp table should be left untouched?

values__tmp__table__1

values__tmp__table__2

values__tmp__table__3

.

.

1 ACCEPTED SOLUTION

Guru

Temp tables like these are created when hive needs to manage intermediate data during an operation. This is normal. They should automatically delete when the operation is over. See these links for more:

If this is what you are looking for, let me know by accepting the answer; else, let me know of any gaps or followup questions.

View solution in original post

3 REPLIES 3

Guru

Temp tables like these are created when hive needs to manage intermediate data during an operation. This is normal. They should automatically delete when the operation is over. See these links for more:

If this is what you are looking for, let me know by accepting the answer; else, let me know of any gaps or followup questions.

Rising Star

I noticed that those tables were present until I stayed within the hive session. After disconnecting and re-establishing the hive session, I didn't find those tables.

Note:

The above links seems to correspond to user creating temporary table with syntax "CREATE TEMPORARY TABLE". However, my inquiry was related to the tables created automatically by Hive.

Expert Contributor

These tables are created by insert statement using VALUES clause - it's part of internal implementation logic. They are temp tables and are session scoped and as you've noticed will go away when the session ends.

Take a Tour of the Community
Don't have an account?
Your experience may be limited. Sign in to explore more.