hive总结

启动源服务

hive --service metastore

ss -nal 查看端口

CREATE TABLE student2(

id int,

name string,

sex string,

age int

)

row format delimited

fields terminated by ',';

create table students(

student_name string ,

likes array<string>,

address map<string,string>

)

row format delimited

fields terminated by ','

collection items terminated by '-'

map keys terminated by ':';

查看数据表结构

desc formatted students;

OK

col_name data_type comment

student_name string

likes array<string>

address map<string,string>

Detailed Table Information

Database: default

Owner: root

CreateTime: Fri Jul 17 10:15:34 EDT 2020

LastAccessTime: UNKNOWN

Retention: 0

Location: hdfs://mycluster/hive/warehouse/students

Table Type: MANAGED_TABLE

Table Parameters:

COLUMN_STATS_ACCURATE {\"BASIC_STATS\":\"true\"}

numFiles 0

numRows 0

rawDataSize 0

totalSize 0

transient_lastDdlTime 1594995334

Storage Information

SerDe Library: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe

InputFormat: org.apache.hadoop.mapred.TextInputFormat

OutputFormat: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat

Compressed: No

Num Buckets: -1

Bucket Columns: \[\]

Sort Columns: \[\]

Storage Desc Params:

colelction.delim -

field.delim ,

mapkey.delim :

serialization.format ,

Time taken: 0.136 seconds, Fetched: 35 row(s)

zhangsan,1-2-3,shanxi:shanxi-xian-yanta:luonan

zhangsan,1-2-3,shaaxi:shanxi-xian-yanta:luona

zhangsan,1-2-3,sichuan:shanxi-xian-yanta:luona

zhangsan,1-2-3,henan:shanxi-xian-yanta:luona

zhangsan,1-2-3,hebei:shanxi-xian-yanta:luona

hive 默认的分割符

内部表和外部表的区别

内部表创建有默认存储位置,外部表需要指定路径

内部表删除元数据和数据,外部表只删除元数据,不删除数据

单 分区

create table students2(

student_name string ,

likes array<string>,

address map<string,string>

)

partitioned by (age int)

row format delimited

fields terminated by ','

collection items terminated by '-'

map keys terminated by ':';

相关推荐
卷毛迷你猪20 小时前
快速实验篇(B06)页面单跳转化率
大数据·hive·hadoop
卷毛迷你猪2 天前
快速实验篇(B02)DWD 生产级升级
大数据·hive·hadoop
卷毛迷你猪2 天前
快速实验篇(B03) 用户行为漏斗与转化率
大数据·hive·hadoop
卷毛迷你猪2 天前
快速实验篇(B01)用户行为日志画像与 DWD 标准化
大数据·hive·hadoop
卷毛迷你猪2 天前
快速实验篇(B04) 热门品类 Top10 与加权排名
大数据·hive·hadoop
CarIise4 天前
Spring Boot整合MyBatis与文件上传:从分层架构到文件上传下载实战
数据仓库·hive·hadoop
ha_lydms4 天前
MaxCompute中加密与解密函数
大数据·数据库·数据仓库·hadoop·dataworks·maxcompute·odps
千桐科技5 天前
数据中台 ETL 编排实践:基于 qData 开源版实现数据接入、转换与调度执行
数据仓库·开源·etl
IT毕设梦工厂6 天前
计算机毕业设计选题推荐:基于大数据的供应链数据分析与可视化|毕业设计选题|计算机毕设|选题推荐|毕设指导|项目定制|源码|高质量项目
大数据·hive·hadoop·python·数据分析·spark·课程设计
IT毕设梦工厂6 天前
计算机毕业设计选题推荐:基于大数据的城市尾气排放数据可视化分析|毕业设计选题|计算机毕设|选题推荐|毕设指导|项目定制|源码|高质量项目
大数据·hive·信息可视化·spark·毕业设计·课程设计·大数据毕设项目