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 ':';

相关推荐
makabalala2 天前
如何利用YashanDB进行数据仓库构建
数据仓库
禅与计算机程序设计艺术2 天前
了解NoSQL的数据仓库和ETL
数据库·数据仓库·nosql·etl
好学且牛逼的马2 天前
从“配置地狱“到“云原生时代“:Spring Boot 1.x到4.x演进全记录与核心知识点详解
hive·spring boot·云原生
派可数据BI可视化3 天前
一文读懂系列:数据仓库为什么分层,分几层?数仓建模方法有哪些
大数据·数据仓库·信息可视化·spark·商业智能bi
Light603 天前
不止于名:领码 SPARK 如何“链”动数据仓库、数据湖、中台与湖仓一体新纪元
大数据·数据仓库·数据湖·ipaas·湖仓一体·数据中台·领码 spark
郑小憨3 天前
FlinkSQL窗口函数TUMBLE、SESSION 和 HOP的区别
大数据·数据仓库·sql·flink·database
码字的字节3 天前
锚点模型:数据仓库中的高度可扩展建模技术详解
大数据·数据仓库·spark
Agentic AI人工智能与大数据3 天前
大数据领域数据仓库的ETL任务优化
大数据·数据仓库·ai·etl
AI架构全栈开发实战笔记3 天前
AI应用架构师教你:如何用AI自动化数据仓库的测试?
数据仓库·人工智能·ai·自动化