Professional Documents
Culture Documents
hive managed
create table t1 (id int);
show tables;
describe t1;
show create table t1;
describe extended t1;
describe formated t1;
quit;
create table t2 (id int)
LOCATION '/user/home/t1';
external table
create external table t3 (id int)
location '/user/home/exter';
drop table t1;
mysql -u root
show databases;
use hive;
show tables;
LOAD DATA LOCAL INPATH 'sourcedata.txt' into table sourcetable;
create table t2 like t1;
LOAD DATA INPATH '/user/hive/warehouse/t1' into table t2; (move)
create table t2_seq (id int , name string)
STORED AS SequenceFile;
insert into table t2_seq
select * from t2;
create table t2_avro (id int , name string)
STORED AS AVRO;
create table t2_orc (id int , name string)
STORED AS ORC;
create table t2_parq (id int , name string)
STORED AS PARQUET;
show tables;
insert overwrite directory 'user/sample/hive_out'
select * from t1;
CREATE TABLE students (name VARCHAR(64), age INT, gpa DECIMAL(3, 2))
CLUSTERED BY (age) INTO 2 BUCKETS STORED AS ORC;
LOCATION '/test/s1';