This tutorial will show you some common usage for creating views. If you have no installed Hive yet please follow this tutorial.
Create View:
CREATE VIEW IF NOT EXISTS test_view AS SELECT * FROM test;
Drop View:
DROP VIEW IF EXISTS test_view;
A place for tutorials on programming and other such works.
This tutorial will show you some common usage for creating views. If you have no installed Hive yet please follow this tutorial.
Create View:
CREATE VIEW IF NOT EXISTS test_view AS SELECT * FROM test;
Drop View:
DROP VIEW IF EXISTS test_view;
This tutorial will show you some common usage for working with tables. If you have no installed Hive yet please follow this tutorial.
Show Tables:
SHOW TABLES;
SHOW TABLES LIKE '*test*';
Table Creation:
CREATE TABLE test (
columnA STRING,
columnB VARCHAR(15),
columnC INT,
columnD TIMESTAMP,
columnE DATE
)
STORED AS ORC;
Table Creation with Partitioning:
CREATE TABLE test_partition (
columnA STRING,
columnB VARCHAR(15),
columnC INT,
columnD TIMESTAMP,
columnE DATE
)
PARTITIONED BY (columnF INT)
STORED AS ORC;
Inline Table Creation:
CREATE TABLE test_inline STORED AS ORC AS
SELECT *
FROM test;
Temporary Table Creation:
CREATE TEMPORARY TABLE temp (
columnA STRING,
columnB VARCHAR(15),
columnC INT,
columnD TIMESTAMP,
columnE DATE
)
STORED AS ORC;
DESC Table:
This will show you the basic definition of a table.
DESC test;
DESC EXTENDED Table:
This will show you the extended definition of a table.
DESC EXTENDED test;
Drop Table:
DROP TABLE IF EXISTS temp;
You must be logged in to post a comment.