Views, Indexes, Temporary Tables
Views
Views can be generated per user needs. Any result set data can be used as a view and the usage in Hive is same as that of a view in SQL. All DML operations can be executed on a view.
Temporary Tables
Temporary tables are a convenient way for an application to automatically manage intermediate data generated during a complex query. Rather than force users to manually delete tables needed only as temporary data in a complex query, Hive automatically deletes all temporary tables at the end of the Hive session in which they are created. The data in these tables is stored in the user's scratch directory rather than in the Hive warehouse directory. The scratch directory effectively acts as the user' data sandbox, located by default in /tmp/hive-<username>.
Hive users create temporary tables using the TEMPORARY keyword:
Multiple Hive users can create multiple Hive temporary tables with the same name because each table resides in a separate session.
Temporary tables support most table options, but not all. The following features are not supported:
Partition columns
Indexes
A temporary table with the same name as a permanent table will cause all references to that table name to resolve to the temporary table. The user cannot access the permanent table during that session without dropping or renaming the temporary table.
Last updated