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

相关推荐
RestCloud8 小时前
2025常用的ETL 产品推荐:助力企业激活数据价值
数据仓库·apache·etl·kettle·数据集成·ibm·informatica
sunxunyong8 小时前
hive/doris查询表的创建和更新时间
数据仓库·hive·hadoop
小钻风336614 小时前
JavaWeb注解的原理
数据仓库·hive·hadoop
涤生大数据15 小时前
数据质量问题中,数据及时性怎么保证?如何有深度体系化回答!
数据仓库·数据治理·数仓·数据开发·及时性
RestCloud1 天前
从ETL到ELT:大数据时代下两者的选型建议及优势
大数据·数据仓库·etl·数字化转型·数据集成平台·elt
程序员老周6661 天前
从MySQL快速上手大数据Hive
大数据·数据库·hive·hadoop·mysql·mapreduce·数据工程师
IT成长日记2 天前
【Hadoop入门】Hadoop生态之Hive简介
大数据·hive·hadoop
Data-Miner2 天前
精品可编辑PPT | 基于湖仓一体构建数据中台架构大数据湖数据仓库一体化中台解决方案
数据仓库
lisacumt2 天前
【trino】trino配置证书https tls/ssl访问
数据仓库
RestCloud3 天前
典型的ETL使用场景与数据集成平台的应用
数据仓库·etl·数字化转型·数据迁移·数据集成·实时cdc