Support Questions

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

Hive: Temporary table created automatically

avatar
Expert Contributor

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

avatar
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

avatar
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.

avatar
Expert Contributor

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.

avatar
Super Collaborator

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.