Create Temporary Table - Hive SQL

Raymond Raymond visibility 2,416 event 2020-08-25 access_time 3 years ago language English

This page shows how to create a temporary Hive table via Hive SQL (HQL).

Create temporary table


(`cust_id` int, `name` string,`created_date` date)

Temporary Hive tables are only visible to the creation session and will be deleted automatically when the session ends. The underlying data is stored in user scratch folder (/tmp/hive/$USERID/*).

Install Hive database

Follow the article below to install Hive on Windows 10 via WSL if you don't have available available Hive database to practice Hive SQL:

Examples on this page are based on Hive 3.* syntax.

Run query

All these SQL statements can be run using beeline CLI:

$HIVE_HOME/bin/beeline --silent=true

The above command line connects to the default HiveServer2 service via beeline. Once beeline is loaded, type the following command to connect:

0: jdbc:hive2://localhost:10000> !connect jdbc:hive2://localhost:10000
Enter username for jdbc:hive2://localhost:10000: hive
Enter password for jdbc:hive2://localhost:10000:
1: jdbc:hive2://localhost:10000>

The terminal looks like the following screenshot:


More from Kontext
info Last modified by Administrator 3 years ago copyright This page is subject to Site terms.
comment Comments
No comments yet.

Please log in or register to comment.

account_circle Log in person_add Register

Log in with external accounts