hive基本操作
- 啟動hive
bin/hive
複製程式碼

show databases;
複製程式碼

use default;
複製程式碼

show tables;
複製程式碼

create table student(id int,name string);
複製程式碼

show tables;
複製程式碼

desc teacher;
複製程式碼

insert into student values(1000,"ss");
複製程式碼

可見插入資料的時候底層為mapreduce
9. 查詢表中資料
select * from teacher;
複製程式碼

quit;
複製程式碼

說明:(檢視hive在hdfs中的結構) 資料庫:在hdfs中表現為${hive.metastore.warehouse.dir}目錄下一個資料夾 表:在hdfs中表現所屬db目錄下一個資料夾,資料夾中存放該表中的具體資料