Skip to content

Instantly share code, notes, and snippets.

@bluesmilery
Last active December 5, 2018 04:55
Show Gist options
  • Save bluesmilery/2f7a650ac2ae66b3fed715147cb12867 to your computer and use it in GitHub Desktop.
Save bluesmilery/2f7a650ac2ae66b3fed715147cb12867 to your computer and use it in GitHub Desktop.
hive
# 表名为TA
# 克隆表,不带数据
create table TA_like like TA
# 将本地文件导入表中
load data local inpath '/local/path' into table TA;
# 查看建表语句
show create table TA
# 删除表
drop table if exists TA
# 删除分区 还可以写成pt<xxx,来批量删除
alter table TA drop if exists partition(pt=xxx)
# 删除表内所有数据(不删除分区)
truncate table TA
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment