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

相关推荐
编织幻境的妖3 小时前
ETL、数据仓库与数据湖详解
数据仓库·etl
爱吃大芒果3 小时前
Flutter 本地存储方案:SharedPreferences、SQFlite 与 Hive
开发语言·javascript·hive·hadoop·flutter·华为·harmonyos
咨询qq 8762239654 小时前
三相逆变器MPC控制:从原理到仿真实践
数据仓库
yumgpkpm5 小时前
(简略)AI 大模型 手机的“简单替换陷阱”与Hadoop、Cloudera CDP 7大数据底座的关系探析
人工智能·hive·zookeeper·flink·spark·kafka·开源
yumgpkpm5 小时前
Cloudera CDP 7.3下载地址、方式,开源适配 CMP 7.3(或类 CDP 的 CMP 7.13 平台,如华为鲲鹏 ARM 版)值得推荐
大数据·hive·hadoop·分布式·华为·开源·cloudera
笨蛋少年派17 小时前
数据仓库系统建设:数据采集、预处理与集成
数据仓库
qq 87622396519 小时前
基于Matlab/simulink的双电机建模驱动控制仿真模型:探索纯电与混动汽车世界
数据仓库
番茄撒旦在上1 天前
Hive数仓分层——国内大数据就业洞察
大数据·数据仓库·hive
yumgpkpm1 天前
hadoop集群搭建 (超详细) 接入Impala、Hive,AI 大模型的数据底座
hive·hadoop·mysql·zookeeper·flink·kafka·hbase
梦里不知身是客112 天前
hive中metastore 服务的意义
数据仓库·hive·hadoop