Hive系列(三)实操

  • 一、Hive使用方式
    • shell交互
    • 启动hiveserver2
    • 脚本化运行
  • 二、Hive建库建表与数据导入
    • 建库
    • 建表
      • 内部表与外部表
      • 分区表
      • CTAS建表语法
    • 数据导入和导出
      • 数据导入
      • 数据导出
    • Hive存储格式
      • TextFile
      • SequenceFile
      • RCFile
      • ORCFile
      • Parquet
  • 三、Hive数据类型
    • 数字类型
    • 时间类型
    • 字符串类型
    • 其他类型
    • 复合(集合)类型
      • array
      • map
      • struct
  • 四、DDL语言
    • 修改表名
    • 修改分区名
    • 添加分区
    • 删除分区
    • 修改表的文件格式
    • 修改列名定义
    • 增加/替换列
    • 修改分区
    • 修改表属性
    • 查看分区
    • 查看table 在HDFS上的存储路经及建表语句
    • 修改表注释

一、Hive使用方式

shell交互

启动一个hive交互shell

bin/hive

启动hiveserver2

第一步:启动hive服务
前台启动命令:

bin/hiveserver2

后台启动命令:

# 不记录日志(日志路径可以根据自己设定)
nohup bin/hiveserver2 1>/dev/null 2>&1 &
# 记录日志
nohup bin/hiveserver2 1>/var/log/hiveserver.log 2>/var/log/hiveserver.err &

第二步:可在其他节点使用beeline去连接
方式一

bin/beeline
# 回车,进入beeline界面
beeline> !connect jdbc:hive2://localhost:10000

方式二:

bin/beeline -u jdbc:hive2://localhost:10000 -n root

脚本化运行

大量的hive查询任务,如果用交互式shell来进行输入的话,显然效率及其低下,因此,生产中更多的是使用脚本化运行机制。
该机制的核心点是:hive可以用一次性命令的方式来执行给定的hql语句
hive -e

bin/hive -e "insert into table a select * from table b;"

hive -f
hive -f 后面跟sql文件

vim test.sql
insert into table a select * from table b;
bin/hive -f test.sql

二、Hive建库建表与数据导入

建库

hive中有一个默认的库:default 库目录:hdfs://localhost:9000/hive/warehouse
新建库:

create database test;

库建好后,在hdfs中会生成一个库目录:
hdfs://localhost:9000/hive/warehouse/test.db

建表

建表语法

CREATE [EXTERNAL] TABLE [IF NOT EXISTS] table_name
[(col_name data_type [COMMENT col_comment], ...)]
[COMMENT table_comment]
[PARTITIONED BY (col_name data_type [COMMENT col_comment], ...)]
[CLUSTERED BY (col_name, col_name, ...)   [SORTED BY (col_name [ASC|DESC], ...)] INTO num_buckets BUCKETS]
[ROW FORMAT row_format]
[STORED AS file_format]
[LOCATION hdfs_path]

说明:
CREATE TABLE
创建一个指定名字的表。如果相同名字的表已经存在,则抛出异常;用户可以用 IF NOT EXISTS 选项来忽略这个异常。
EXTERNAL
EXTERNAL关键字可以让用户创建一个外部表,在建表的同时指定一个指向实际数据的路径(LOCATION),Hive 创建内部表时,会将数据移动到数据仓库指向的路径;若创建外部表,仅记录数据所在的路径,不对数据的位置做任何改变。在删除表的时候,内部表的元数据和数据会被一起删除,而外部表只删除元数据,不删除数据。
LIKE
允许用户复制现有的表结构,但是不复制数据。
ROW FORMAT
用户在建表的时候可以自定义 SerDe 或者使用自带的 SerDe。如果没有指定 ROW FORMAT 或者 ROW FORMAT DELIMITED,将会使用自带的 SerDe。在建表的时候,用户还需要为表指定列,用户在指定表的列的同时也会指定自定义的 SerDe,Hive通过 SerDe 确定表的具体的列的数据。
DELIMITED FIELDS TERMINATED BY ‘,’ 字段分隔符
DELIMITED LINES TERMINATED BY ‘,’ 行分割符
CLUSTERED BY
对于每一个表(table)或者分区, Hive可以进一步组织成桶,也就是说桶是更为细粒度的数据范围划分。Hive也是 针对某一列进行桶的组织。Hive采用对列值哈希,然后除以桶的个数求余的方式决定该条记录存放在哪个桶当中。

把表(或者分区)组织成桶(Bucket)有两个理由:
(1)获得更高的查询处理效率。桶为表加上了额外的结构,Hive 在处理有些查询时能利用这个结构。具体而言,连接两个在(包含连接列的)相同列上划分了桶的表,可以使用 Map 端连接 (Map-side join)高效的实现。比如JOIN操作。对于JOIN操作两个表有一个相同的列,如果对这两个表都进行了桶操作。那么将保存相同列值的桶进行JOIN操作就可以,可以大大较少JOIN的数据量。
(2)使取样(sampling)更高效。在处理大规模数据集时,在开发和修改查询的阶段,如果能在数据集的一小部分数据上试运行查询,会带来很多方便。
STORED AS SEQUENCEFILE|TEXTFILE|RCFILE
如果文件数据是纯文本,可以使用 STORED AS TEXTFILE。如果数据需要压缩,使用 STORED AS SEQUENCEFILE。

内部表与外部表

外部表和内部表的特性差别:

  • 内部表的目录在hive的仓库目录中 VS 外部表的目录由用户指定
  • drop一个内部表时:hive会清除相关元数据,并删除表数据目录
  • drop一个外部表时:hive只会清除相关元数据

创建外部表

drop table if exists user_info_external;
create external table if not exists user_info_external(
user_id string comment '用户id',
user_name string comment '用户姓名',
user_gender string comment '用户性别',
user_age int comment '用户年龄',
province string comment '省份',
city string comment '城市'
)
comment '用户信息表'
row format delimited fields terminated by ',' lines terminated by '\n'
location '/input/user_info'
;

注意:localtion后面跟路径为目录。

hive (test)> select * from user_info_external;
OK
user_info.user_id   user_info.user_name user_info.user_gender   user_info.user_age  user_info.province  user_info.city
1   ChengHe M   35  FuJian  FuZhou
2   WangYuan    M   20  ChongQing   ChongQing
3   ZhengKai    M   34  ShangHai    ShangHai
4   NiNi    F   32  JiangSu NanJing
5   ChenKun M   44  ChongQing   ChongQing
6   JinChen F   30  ShanDong    JiNan
7   SunLi   F   38  ShangHai    ShangHai
8   DengChao    M   41  JiangXin    NanChang
9   LuHan   M   30  BeiJing BeiJing
10  GuanXiaoTong    F   23  BeiJing BeiJing
Time taken: 1.287 seconds, Fetched: 10 row(s)

创建内部表:

drop table if exists user_info;
create table if not exists user_info(
user_id string comment '用户id',
user_name string comment '用户姓名',
user_gender string comment '用户性别',
user_age int comment '用户年龄',
province string comment '省份',
city string comment '城市'
)
comment '用户信息表'
row format delimited fields terminated by ',' lines terminated by '\n'
;

注意:hive是不会检查用户导入表中的数据的!如果数据的格式跟表定义的格式不一致,hive也不会做任何处理(能解析就解析,解析不了就是null);

分区表

分区表的实质是:在表目录中为数据文件创建分区子目录,以便于在查询时,MR程序可以针对指定的分区子目录中的数据进行处理,缩减读取数据的范围,提高效率!
比如,网站每天产生的浏览记录,浏览记录应该建一个表来存放,但是,有时候,我们可能只需要对某一天的浏览记录进行分析
这时,就可以将这个表建为分区表,每天的数据导入其中的一个分区;
当然,每日的分区目录,应该有一个目录名(分区字段)

单个分区字段

drop table if exists user_info_partition_single;
create table if not exists user_info_partition_single(
user_id string comment '用户id',
user_name string comment '用户姓名',
user_gender string comment '用户性别',
user_age int comment '用户年龄'
)
comment '用户信息表'
partitioned by(province string)
row format delimited fields terminated by ',' lines terminated by '\n'
;

插入数据

insert overwrite table user_info_partition_single partition(province='BeiJing')
select '11' as user_id,
'YangZi' as user_name,
'F' as user_gender,
28 as user_age
;

查看HDFS文件

[root@localhost input]# hdfs dfs -ls /hive/warehouse/test.db/user_info_partition_single/province=BeiJing
Found 1 items
-rwxrwxrwx   1 root supergroup         15 2021-01-06 19:00 /hive/warehouse/test.db/user_info_partition_single/province=BeiJing/000000_0

多个分区字段

drop table if exists user_info_partition_multiple;
create table if not exists user_info_partition_multiple(
user_id string comment '用户id',
user_name string comment '用户姓名',
user_gender string comment '用户性别',
user_age int comment '用户年龄'
)
comment '用户信息表'
partitioned by(province string,city string)
row format delimited fields terminated by ',' lines terminated by '\n'
;

动态分区

drop table if exists user_info_partition_dynamic;
create table if not exists user_info_partition_dynamic(
user_id string comment '用户id',
user_name string comment '用户姓名',
user_gender string comment '用户性别',
user_age int comment '用户年龄'
)
comment '用户信息表'
partitioned by(province string)
row format delimited fields terminated by ',' lines terminated by '\n'
;set hive.exec.dynamic.partition.mode=nonstrict;
set hive.exec.dynamic.partition=true;
--每个节点可以创建的最大分区数 默认值:100
set hive.exec.max.dynamic.partitions.pernode=10000;
--每个 mr 可以创建的最大分区数 默认值:1000
set hive.exec.max.dynamic.partitions=10000;insert overwrite table user_info_partition_dynamic PARTITION(province) select user_id,user_name,user_gender,user_age,province from user_info_external;

查询:

hive (test)> show partitions user_info_partition_dynamic;
OK
partition
province=BeiJing
province=ChongQing
province=FuJian
province=JiangSu
province=JiangXin
province=ShanDong
province=ShangHai
Time taken: 0.077 seconds, Fetched: 7 row(s)hive (test)> show partitions user_info_partition_dynamic;
OK
partition
province=BeiJing
province=ChongQing
province=FuJian
province=JiangSu
province=JiangXin
province=ShanDong
province=ShangHai
Time taken: 0.077 seconds, Fetched: 7 row(s)hive (test)> select * from user_info_partition_dynamic where province='BeiJing';
OK
user_info_partition_dynamic.user_id user_info_partition_dynamic.user_name   user_info_partition_dynamic.user_gender user_info_partition_dynamic.user_age    user_info_partition_dynamic.province
9   LuHan   M   30  BeiJing
10  GuanXiaoTong    F   23  BeiJing
Time taken: 0.418 seconds, Fetched: 2 row(s)

外部分区表

drop table if exists person;
create external table if not exists person(
user_id string comment '用户id',
user_name string comment '用户名称',
user_gender string comment '用户性别',
user_age int comment '用户年龄'
)
comment '用户表'
partitioned by(user_address string)
row format delimited fields terminated by ',' lines terminated by '\n'
location '/input/person'
;-- 外部表加载数据
alter table person add partition (user_address='suzhou') location '/input/person/suzhou';

注意:构建外部分区表,虽然location指定了表数据的位置,单此时查询表会发现没有数据,需要手动往每个分区添加数据

CTAS建表语法

可以通过已存在表来建表:

create table a like table b;

新建的a表结构定义与源表b一致,但是没有数据
在键表的同时插入数据

create table a as select * from table b;

数据导入和导出

数据导入

方式1:用hdfs命令,将文件放入表目录;

[root@localhost input]# hdfs dfs -put /home/huangwei/input/beijing.txt /hive/warehouse/test.db/user_info_partition_single/province='BeiJing'

查询

hive> select * from user_info_partition_single where province='BeiJing';
OK
11  YangZi  F   28  BeiJing
9   LuHan   M   30  BeiJing
10  GuanXiaoTong    F   23  BeiJing
Time taken: 0.19 seconds, Fetched: 3 row(s)

方式2:在hive的交互式shell中用hive命令来导入本地数据到表目录

hive> load data local inpath '/home/huangwei/input/beijing.txt' into table user_info;
Loading data to table test.user_info
OK
Time taken: 0.636 seconds
hive> select * from user_info;
OK
9   LuHan   M   30  BeiJing BeiJing
10  GuanXiaoTong    F   23  BeiJing BeiJing
Time taken: 0.181 seconds, Fetched: 2 row(s)

方式3:用hive命令导入hdfs中的数据文件到表目录

hive> load data local inpath '/home/huangwei/input/beijing.txt' into table user_info;

方式4:如果目标表是一个分区表

hive> load data local inpath '/home/huangwei/input/beijing.txt' into table user_info_partition_single partition(province='BeiJing');
Loading data to table test.user_info_partition_single partition (province=BeiJing)
OK
Time taken: 0.45 seconds
hive> select * from user_info_partition_single where province='BeiJing';
OK
11  YangZi  F   28  BeiJing
9   LuHan   M   30  BeiJing
10  GuanXiaoTong    F   23  BeiJing
Time taken: 0.132 seconds, Fetched: 3 row(s)

数据导出

将hive表中的数据导入HDFS的文件

insert overwrite directory '/hive/output' row format delimited fields terminated by ',' select * from user_info_partition_single where province='BeiJing';

将hive表中的数据导入本地磁盘文件

insert overwrite local directory '/home/huangwei/output' row format delimited fields terminated by ',' select * from user_info_partition_single where province='BeiJing';

Hive存储格式

hive文件存储格式包括以下几类:

  • TEXTFILE
  • SEQUENCEFILE
  • RCFILE
  • ORCFILE(0.11以后出现)
  • PARQUET

注意:其中TEXTFILE为默认格式,建表时不指定默认为这个格式,导入数据时会直接把数据文件拷贝到hdfs上不进行处理; SEQUENCEFILE,RCFILE,ORCFILE,PARQUET格式的表不能直接从本地文件导入数据,数据要先导入到TEXTFILE格式的表中,然后再从表中用insert导入SequenceFile,RCFile,ORCFile,PARQUET表中;或者用复制表结构及数据的方式(create table as select * from table )。

TextFile

默认格式;

存储方式为行存储;

磁盘开销大 数据解析开销大;

但使用这种方式,hive不会对数据进行切分,从而无法对数据进行并行操作。

drop table if exists user_info;
create table if not exists user_info(
user_id string comment '用户id',
user_name string comment '用户姓名',
user_gender string comment '用户性别',
user_age int comment '用户年龄',
province string comment '省份',
city string comment '城市'
)
comment '用户信息表'
row format delimited fields terminated by ',' lines terminated by '\n'
stored as textfile;
;

SequenceFile

二进制文件,以<key,value>的形式序列化到文件中;
存储方式:行存储;
可分割 压缩;
一般选择block压缩;
优势是文件和Hadoop api中的mapfile是相互兼容的

drop table if exists user_info;
create table if not exists user_info(
user_id string comment '用户id',
user_name string comment '用户姓名',
user_gender string comment '用户性别',
user_age int comment '用户年龄',
province string comment '省份',
city string comment '城市'
)
comment '用户信息表'
row format delimited fields terminated by ',' lines terminated by '\n'
stored as sequencefile;
;

RCFile

存储方式:数据按行分块 每块按照列存储;
压缩快 快速列存取,查询快,写操作慢;
读记录尽量涉及到的block最少;
读取需要的列只需要读取每个row group 的头部定义;
读取全量数据的操作 性能可能比sequencefile没有明显的优势

drop table if exists user_info;
create table if not exists user_info(
user_id string comment '用户id',
user_name string comment '用户姓名',
user_gender string comment '用户性别',
user_age int comment '用户年龄',
province string comment '省份',
city string comment '城市'
)
comment '用户信息表'
row format delimited fields terminated by ',' lines terminated by '\n'
stored as rcfile;

ORCFile

存储方式:数据按行分块 每块按照列存储;
压缩快 快速列存取;
效率比rcfile高,是rcfile的改良版本。

drop table if exists user_info;
create table if not exists user_info(
user_id string comment '用户id',
user_name string comment '用户姓名',
user_gender string comment '用户性别',
user_age int comment '用户年龄',
province string comment '省份',
city string comment '城市'
)
comment '用户信息表'
row format delimited fields terminated by ',' lines terminated by '\n'
stored as orcfile;
;

Parquet

类似于orc,相对于orc文件格式,hadoop生态系统中大部分工程都支持parquet文件。

drop table if exists user_info;
create table if not exists user_info(
user_id string comment '用户id',
user_name string comment '用户姓名',
user_gender string comment '用户性别',
user_age int comment '用户年龄',
province string comment '省份',
city string comment '城市'
)
comment '用户信息表'
row format delimited fields terminated by ',' lines terminated by '\n'
stored as parquet;
;

无论从占用空间、压缩比、执行时间等,ORCFile存储方式到读操作效率最高
耗时:ORCFile<Parquet<RCFile<TextFile
用ORC格式,查询时需先将数据导入textfile格式的临时表
Failed with exception java.io.IOException:org.apache.orc.FileFormatException: Malformed ORC file hdfs:…

三、Hive数据类型

数字类型

  • TINYINT (1字节整数)
  • SMALLINT (2字节整数)
  • INT/INTEGER (4字节整数)
  • BIGINT (8字节整数)
  • FLOAT (4字节浮点数)
  • DOUBLE (8字节双精度浮点数)

时间类型

  • TIMESTAMP (时间戳) (包含年月日时分秒毫秒的一种封装)
  • DATE (日期)(只包含年月日)

字符串类型

  • STRING

其他类型

  • BOOLEAN(布尔类型):true false

复合(集合)类型

  • array数组类型
  • map类型
  • struct类型

array

数据示例:

h93u9eh92h92h28yhhe,F,25-26岁,唱歌|购物|跑步
djiu39edj93j9jd39ue,M,25-26岁,健身|读书
drop table if exists jg_tag;
create table if not exists jg_tag (
jid string comment '唯一标志符',
gender string comment '性别',
age string comment '年龄段',
love array<string> comment '喜好'
)
comment '标签表'
row format delimited fields terminated by ','
collection items terminated by '|'
;-- 加载数据
load data local inpath '/home/huangwei/input/tag.txt' into table jg_tag;

查询:

 select * from jg_tag;
+----------------------+----------------+-------------+------------------------+
|      jg_tag.jid      | jg_tag.gender  | jg_tag.age  |    jg_tag.love         |
+----------------------+----------------+-------------+------------------------+
| h93u9eh92h92h28yhhe  | F              | 25-26岁      | ["唱歌","购物","跑步"]  |
| djiu39edj93j9jd39ue  | M              | 25-26岁      | ["健身","读书"]        |
+----------------------+----------------+-------------+------------------------+

map

数据实例:

1201,Mary,height:165cm#weight:55kg#blood pressure:130
1208,Bob,height:173cm#weight:70kg#blood pressure:129
drop table if exists physical_examination_info;
create table if not exists physical_examination_info (
student_id string comment '学生编号',
student_name string comment '姓名',
report_restlt map<string,string> comment '体检信息'
)
comment '体检信息表'
row format delimited fields terminated by ','
collection items terminated by '#'
map keys terminated by ':'
;
-- 加载数据
load data local inpath '/home/huangwei/input/physical.txt' into table physical_examination_info;

查询:

select * from physical_examination_info;
+---------------------------------------+-----------------------------------------+----------------------------------------------------+
| physical_examination_info.student_id  | physical_examination_info.student_name  |      physical_examination_info.report_restlt       |
+---------------------------------------+-----------------------------------------+----------------------------------------------------+
| 1201                                  | Mary                                    | {"height":"165cm","weight:55kg":null,"blood pressure:130":null} |
| 1208                                  | Bob                                     | {"height":"173cm","weight:70kg":null,"blood pressure:129":null} |
+---------------------------------------+-----------------------------------------+----------------------------------------------------+
2 rows selected (0.543 seconds)

struct

数据示例:

1201,Mary#98
1209,LiLi#79
1203,Hardon#86
drop table if exists score;
create table if not exists score (
s_id string comment '学生编号',
s_info struct<s_name:string,socre:int> comment '分数'
)
comment '分数表'
row format delimited fields terminated by ','
collection items terminated by '#'
;load data local inpath '/home/huangwei/input/score.txt' into table score;

查询:

select * from score;
+-------------+---------------------------------+
| score.s_id  |          score.s_info           |
+-------------+---------------------------------+
| 1201        | {"s_name":"Mary","socre":98}    |
| 1209        | {"s_name":"LiLi","socre":79}    |
| 1203        | {"s_name":"Hardon","socre":86}  |
+-------------+---------------------------------+
3 rows selected (0.321 seconds)

四、DDL语言

创建表

drop table if exists order_items;
create table if not exists order_items (
order_id string comment '订单编号',
amount double comment '订单金额',
catagory string comment '商品类型'
)
comment '订单表'
partitioned by(order_date date)
row format delimited fields terminated by ',' lines terminated by '\n'
stored as textfile
;

插入数据

load data local inpath '/home/huangwei/input/order/2020-12-12' into table order_items partition(order_date='2020-12-12');

修改表名

alter table order_items rename to order_items_jd;

修改分区名

alter table order_items_jd partition(order_date='2020-12-12') rename to partition(order_date='2020-11-11');

查询:

hive> select * from order_items_jd where order_date='2020-11-11';
OK
JD94848448  88.6    日用品 2020-11-11
JD98929778  4896.6  电子产品    2020-11-11
JD69897487  1879.2  化妆品 2020-11-11
JD96989784  196.8   休闲零食    2020-11-11
JD96989768  388.6   服饰  2020-11-11
JD69977878  998.6   化妆品 2020-11-11
JD96989777  593.7   母婴用品    2020-11-11
JD96989763  63.8    个护用品    2020-11-11
JD96989784  696.8   服饰  2020-11-11
JD98784669  3888.6  家电  2020-11-11
Time taken: 0.179 seconds, Fetched: 10 row(s)

添加分区

alter table order_items_jd add if not exists partition(order_date='2020-12-12');

删除分区

alter table order_items_jd drop if exists partition(order_date='2020-12-12');

修改表的文件格式

alter table order_items_jd partition(order_date='2020-11-11') set fileformat orcfile;

修改列名定义

语法:alter table table_name change old_column new_column new_column_type comment ‘商品类型’;

alter table order_items_jd change catagory item_type string comment '商品类型';

增加/替换列

alter table order_items_jd add columns(city string);
alter table t_user replace columns (id string,count double,type string);

修改分区

alter table order_items_jd partition(order_date='2020-11-11') set location "hive/warehouse/test.db/order_items_jd/order_date=2020-12-12"
alter table order_items_jd partition(order_date='2020-11-11') rename to partition(order_date='20201111')

修改表属性

-- 内部表转外部表
alter table order_items_jd set tblproperties('external'='true');
-- 外部表转内部表
alter table order_items_jd set tblproperties('external'='false')

查看分区

hive> describe formatted order_items_jd partition(order_date='2020-11-11');
OK
# col_name              data_type               comment             order_id                string                  ????
amount                  double                  ????
catagory                string                  ??                  # Partition Information
# col_name              data_type               comment             order_date              date                                        # Detailed Partition Information
Partition Value:        [2020-11-11]
Database:               test
Table:                  order_items_jd
CreateTime:             Thu Jan 07 11:40:29 CST 2021
LastAccessTime:         UNKNOWN
Location:               hdfs://localhost:9000/hive/warehouse/test.db/order_items_jd/order_date=2020-11-11
Partition Parameters:        last_modified_by       root                last_modified_time      1609999013          numFiles                2                   numRows                 0                   rawDataSize             0                   totalSize               274                 transient_lastDdlTime   1609999013          # Storage Information
SerDe Library:          org.apache.hadoop.hive.ql.io.orc.OrcSerde
InputFormat:            org.apache.hadoop.hive.ql.io.orc.OrcInputFormat
OutputFormat:           org.apache.hadoop.hive.ql.io.orc.OrcOutputFormat
Compressed:             No
Num Buckets:            -1
Bucket Columns:         []
Sort Columns:           []
Storage Desc Params:         field.delim            ,                   line.delim              \n                  serialization.format    ,
Time taken: 0.12 seconds, Fetched: 39 row(s)

查看table 在HDFS上的存储路经及建表语句

hive> show create table order_items_jd ;
OK
CREATE TABLE `order_items_jd`(`order_id` string COMMENT '????', `amount` double COMMENT '????', `item_type` string COMMENT '????')
COMMENT '???'
PARTITIONED BY ( `order_date` date)
ROW FORMAT SERDE 'org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe'
WITH SERDEPROPERTIES ( 'field.delim'=',', 'line.delim'='\n', 'serialization.format'=',')
STORED AS INPUTFORMAT 'org.apache.hadoop.mapred.TextInputFormat'
OUTPUTFORMAT 'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'
LOCATION'hdfs://localhost:9000/hive/warehouse/test.db/order_items_jd'
TBLPROPERTIES ('last_modified_by'='root', 'last_modified_time'='1609999662', 'transient_lastDdlTime'='1609999662')
Time taken: 0.092 seconds, Fetched: 23 row(s)

修改表注释

alter table order_items_jd set tblproperties('comment'='订单分区表');

Hive系列(三)实操相关推荐

  1. 发那科FANUC系列工业机器人实操应用

    发那科FANUC系列工业机器人实操应用 目录: 第一章:安全注意事项. 一.注意事项 1.FANUC机器人所有者.操作者必须对自己的安全负责.FANUC不对机器使用的安全问题负责.FANUC提醒用户在 ...

  2. 【k8s记录系列】实操kubeadm安装部署Kubernetes集群全过程 V1.20.5

    首先感谢王跃辉我辉哥提供的技术支持,嘿嘿! 准备工具:VMware(已经启动好三台Linux服务器Centos7.x版本),远程连接工具putty,xshell等 如果还没有安装虚拟机,或者不知道怎么 ...

  3. Hive系列 (一):Hive搭建

    文章目录 Hive系列文章 一.环境信息 二.hive下载安装 三.mysql下载安装及配置 四.Hive配置 五.启动服务 六.beeline配置 七.beeline一键启动脚本 八.注意事项 Hi ...

  4. Hive系列 (六):Hive数据类型转换

    文章目录 Hive系列文章 数据类型转换 Cast显示转换 数据类型转换表 日期类型转换说明 转换示例 Hive系列文章 Hadoop完全分布式搭建(腾讯云服务器+阿里云服务器) Hive系列 (一) ...

  5. 图解大数据 | Hive搭建与应用@实操案例

    作者:韩信子@ShowMeAI 教程地址:http://www.showmeai.tech/tutorials/84 本文地址:http://www.showmeai.tech/article-det ...

  6. 华为昇腾师资培训沙龙·南京场 |华为昇腾 ACL 语言开发实践全程干货来了!看完就实操系列...

    自今年疫情以来,AI 技术加速进入了人们的视线,在抗疫过程中发挥了重要作用,产业发展明显提速,我国逐步走出了一条由需求导向引领商业模式创新.市场应用倒逼基础理论和关键技术创新的发展道路,AI 人才的争 ...

  7. 不同网段的局域网怎么互通_华为实操系列 | 交换机在局域网中是怎么应用的,看完你肯定懂了!...

    编辑 | 排版 | 制图 | 测试 | ©瑞哥 此文用时0小时48分钟,原创不易,坚持更不易,希望我的每一份劳动成果都可以得到大家的一个[在看] 交换机在局域网中的应用 交换机在局域网中的应用分为两种 ...

  8. 华为交换机实操系列(资源)

    一.华为实操系列 | 怎样远程登录设备–telnet方式 1.应用场景 用户可以通过telnet远程登录设备,对设备进行远程管理和维护. 用户希望使用AAA验证方法登录远程设备,进而可以方便地对其进行 ...

  9. 【外行也能看懂的RabbitMQ系列(二)】—— RabbitMQ的Web管理界面(rabbitmq_management)详解(内含Topic模式通配符实操)

    系列文章目录 准备篇 RabbitMQ安装文档 第一章 RabbitMQ快速入门篇 第二章 RabbitMQ的Web管理界面详解 第三章 RabbitMQ进阶篇之死信队列 第四章 RabbitMQ进阶 ...

  10. DIV+CSS实操三:经管系网页内容模块添加标题栏和版权信息模块

    我们继续接着DIV+CSS实操一:经管系网页总体模块布局和DIV+CSS实操二:经管系网页添加导航栏和友情链接 栏这个系列的博文做经管系网页.这一次我们所要做的就是给内容版块添加标题栏,还有就是给制作 ...

最新文章

  1. [jdk8]Predicate 函数式接口
  2. UA SIE545 优化理论基础3 Fritz-John与Kuhn-Tucker理论总结 带等式约束与不等式约束的极值问题
  3. 新入职一家公司如何梳理业务?
  4. SwiftUI之深入解析高级动画的时间轴TimelineView
  5. 关于 redis、memcache、mongoDB 的对比
  6. DPMM的理解、公式推导及抽样
  7. 滴滴上线自动驾驶服务;微软宣布将永久关闭实体店;.NET 5.0 Preview 6 发布 | 极客头条...
  8. 《java 程序设计教程》:毕
  9. 互联网金融风控模型大全
  10. 使用 DISM 工具检查并修复 Windows 系统文件
  11. 股市财富神话背后:黑庄黑嘴制造多少黑洞
  12. error: ‘xcb_generic_event_t’ was not declared in this scope
  13. Unity3D移动平台简单实现
  14. 用了五年 VS Code ,我决定换成 JetBrains…
  15. WordPress快速增加百度收录的方法
  16. 兼容iOS 10 _升级xcode8_适配(四)
  17. postgresql 数据库出现 autovacuum:VACUUM xxoo.xxoo (to prevent wraparound)
  18. pytorch版本和cuda版本对应
  19. 收集一些好玩的注释,HAVE FUN!!!
  20. 邮政快递单号可以批量查询吗

热门文章

  1. 动词ing形式的5种用法_动词ing形式的5种用法
  2. 目标文件夹访问被拒绝,您需要权限来执行此操作
  3. CocosDashboard课堂笔记
  4. windows无法连接到某个wifi_电脑提示Windows无法连接到这个网络/无线网络的解决方法...
  5. JavaScript实现节点的增加修改删除查找
  6. python什么字体好看_python docx 中文字体设置的操作方法
  7. Photoshop CC 2017工具的使用
  8. 函数的连续性以及间断点
  9. 可重入锁模拟三个线程之间的通信
  10. python烤地瓜实例(深入理解面向对象编程)