I run queries in Hive...I wanted to create a temporary tables to save intermediate results of a complex query. Here is my query:

SELECT * FROM my_table

The query ran through without reporting an error. But when I did a select statement from the table I got this error "Table test is not found". Is temporary table supported in Hive? I read docs and posts here and there. Most say yes so I do not know what is wrong.

  • As documentation claims A table that has been created as a temporary table will only be visible to the current session. If it is not accessible then you use another connection for your access attempt.
    – Akina
    Jan 28, 2021 at 5:12
  • @Akina I was not using another connection. I ran the select statement immediately after the temp table was created. Jan 28, 2021 at 16:05
  • @Akina oh does it mean I can only refer to the temp table in the same query? Jan 28, 2021 at 16:43
  • I don't know, I do not deal with Hive. Test does it can process a batch (a lot of queries in one command). Maybe it uses connection pool, and each command sent to MySQL uses next connection from free ones in the pool - if so then disable pool usage. As the last option create a procedure which creates and uses temptable, and call it.
    – Akina
    Jan 28, 2021 at 17:12


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.