创建库:create database 库名;
删除库:drop database 库名;
修改库:alter database 库名 set dbproperties('键'='值');
查看库:desc database 库名;
创建表:create table 表名;
删除表:drop table 表名;
修改表:alter table 表名 set tblproperties('external'='true'修改为外部表/'external'='false'修改为内部表);
查看表:select * from 表名;
查看表类型:desc formatted 表名;
插入数据:insert into table 表名 partition(分区位置) values(值1),(值2);
删除表中的数据:truncate table 表名;
追加覆盖数据:insert overwrite table 表名 partition(分区位置) select 列名1,列名2 from 表名 where 位置;
查询数据:select * from 表名;
hive 库、表、数据的增删改查语法
最新推荐文章于 2024-05-27 12:30:00 发布