hive
2023-03-29 22:20:31 4 举报
AI智能生成
登录查看完整内容
hive基础
作者其他创作
大纲/内容
HIVE
create database DBname;
创建数据库
集合数据类型Data_Typeprimitive_typeArray<data_type>span style=\"font-size: inherit;\
数据类型
create table tbname(col type [comment \"col_comment\"])[COMMENT 'This is an external table'][ROW FORMAT DELIMITED ][FIELDS TERMINATED BY '|' ] //如何分隔列(字段)[collection items terminated by \
create table tbname1 like tbname; //复制表结构
//把一张表的某些字段抽取出来,创建成一张新表,使用ascreate table tbname as tbname
建表的三种语句
内部表:删除表时,元数据与数据都会被删除
外部表:删除表只删除metastore的元数据,不删除表数据
内部表/外部表
set hive.cli.print.current.db=true;提示显示当前数据库
hive数据仓库配置属性
show databases like '*site'; 筛选查找库desc database db_name 查看数据仓库详细信息desc database extended db_name 查看数据仓库详细信息show tables 查看库下的表desc 查看表结构desc extended table_name //查看更多扩展信息desc formatted table_name select *from table_name 查看数据表数据
查询
对表的一些操作
DDL数据定义
收藏
0 条评论
回复 删除
下一页