如果配置单元(0.13)SELECT和INSERT OVERWRITE同时运行,会发生什么情况 [英] What will happen if a hive(0.13) SELECT and INSERT OVERWRITE are running at the same time

查看:117
本文介绍了如果配置单元(0.13)SELECT和INSERT OVERWRITE同时运行,会发生什么情况的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道如果同时运行配置单元SELECT和INSERT OVERWRITE会发生什么情况.请帮助我了解在以下情况下配置单元查询将返回什么.

I would like to know what will happen if a hive SELECT and INSERT OVERWRITE is running at the same time. Please help me to understand what will hive query return in the below scenarios.

在运行查询时,先运行查询,然后插入同一表.

Run the query first, while the query is running, INSERT OVERWRITE the same table.

首先运行INSERT OVERWRITE,在覆盖的同时,使用SELECT从同一表中提取数据.

Run the INSERT OVERWRITE first, while overwriting, pull the data from the same table with SELECT.

我们要获取旧数据,新数据,混合数据,什么都没有或不可预测的数据吗?

Are we going to get the old data, new data, mixed data, nothing, or unpredictable data?

我正在使用MapR 4.0.1,Hive 0.13.

I am using MapR 4.0.1, Hive 0.13.

最诚挚的问候,

瑞安

推荐答案

阅读蜂巢锁定:

对于未分区的表,锁定模式非常直观.读取表时,将获得S锁,而对于所有其他操作(插入到表,任何类型的alter table等)都将获得X锁.

For a non-partitioned table, the lock modes are pretty intuitive. When the table is being read, a S lock is acquired, whereas an X lock is acquired for all other operations (insert into the table, alter table of any kind etc.)

因此SELECT和INSERT获得了不兼容的锁,因此它们永远无法并行运行.一个将首先获取锁,另一个将等待.

So SELECT and INSERT acquire incompatible locks so they can never run in parallel. One will acquire the lock first and the other will wait.

对于分区表,由于获取的锁是分层的(表上为S,分区上为S/X),因此情况有些复杂.阅读链接.

For partitioned tables things are a bit more complex as the locks acquire are hierarchical (S on table, S/X on partition). Read the link.

这篇关于如果配置单元(0.13)SELECT和INSERT OVERWRITE同时运行,会发生什么情况的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆