Does Hive support temporary tables? I can't find it in the apache docs.
相关问题
- Spark on Yarn Container Failure
- enableHiveSupport throws error in java spark code
- spark select and add columns with alias
- Unable to generate jar file for Hadoop
-
hive: cast array
> into map
相关文章
- 在hive sql里怎么把"2020-10-26T08:41:19.000Z"这个字符串转换成年月日
- Java写文件至HDFS失败
- mapreduce count example
- SQL query Frequency Distribution matrix for produc
- Cloudera 5.6: Parquet does not support date. See H
- Could you give me any clue Why 'Cannot call me
- converting to timestamp with time zone failed on A
- Hive error: parseexception missing EOF
As of Hive 0.14.0 Thanks to @hwrdprkns for commenting. As of Hive 0.14.0 there is support for temporary tables https://cwiki.apache.org/confluence/display/Hive/LanguageManual+DDL#LanguageManualDDL-TemporaryTables
Link to the JIRA: https://issues.apache.org/jira/browse/HIVE-7090
The syntax is
CREATE TEMPORARY TABLE TABLE_NAME_HERE (key string, value string)
Pre Hive 0.14.0
I don't think Hive has temporary tables the same as something like SQL Server does. You can do something like temporary tables with Hive though.
If you create a table with the schema your temporary table needs, then do a query populating the table before you run the query needing the data, it will act like a temporary table.
The steps would be:
INSERT OVERWRITE TABLE temptbl <select_query>
When you run your query you can use
temptbl
like any other table. TheINSERT OVERWRITE
will overwrite all data in the table so it will only be populated with data for that run. The data persists, so if you re-use the table without re-populating it, you will be using the data from whatever the last run was.This can definitely run into issues if the same table will be needed at the same time but for different data...
From what I've been able to find, this is the only solution to a 'temporary' table in Hive right now.