庫(kù)
創(chuàng)建庫(kù)
CREATE DATABASE IF NOT EXISTS db01;
查看庫(kù)
SHOW DATABASES;
使用庫(kù)
USE db01;
刪除庫(kù)
DROP DATABASE db01;
表
查看表
SHOW TABLES;
創(chuàng)建分區(qū)表
CREATE TABLE IF NOT EXISTS tab_01 (colume01 string)
partitioned by (colume02 string)
row format delimited
fields terminated by '\t';
查看分區(qū)
SHOW PARTITIONS tab_01;
插入分區(qū)數(shù)據(jù)
INSERT INTO TABLE tab_01 partition(colume02='xxxx') VALUES ('yyyy');
查看分區(qū)數(shù)據(jù)
SELECT * FROM tab_01 WHERE colume02='xxxx';