Hive Table Related Commands

Hive Table Related Commands

This tutorials will explain the multiple table related commands for Hive.

Hive Table for Examples: Lets create below table for demonstrating table related commands.

CREATE TABLE hiveFirstTable
(  
   order_id INT,
   order_date STRING,
   cust_id INT,
   order_status STRING
)
ROW FORMAT delimited 
FIELDS TERMINATED BY ',' 
LINES TERMINATED BY '\n'
STORED AS textfile;

Detail and description of the Hive tables

Display column header for Queries: SELECT queries does not show column headers by default in hive console. Below property can be set to display same.

SET hive.cli.print.header=true;


Adding/replacing columns in Hive Table