1. 建表, 存储格式为 ORC 格式
代码语言:javascript复制create table if not exists record_orc (
rid string,
uid string,
bid string,
price int,
source_province string,
target_province string,
site string,
express_number string,
express_company string,
trancation_date date
)
stored as orc;
-- 查看建表信息
show create table record_orc;
-- 另一种建表方式
create table record_parquet like record_orc stored as parquet;
2. 导入数据
代码语言:javascript复制insert into table record_orc select * from record;
3. 查看 hdfs 文件所占空间的大小
代码语言:javascript复制hdfs dfs -ls /warehouse/mydb.db/record
hdfs dfs -ls /warehouse/mydb.db/record_parquet
hdfs dfs -ls /warehouse/mydb.db/record_orc