主键约束和外键约束在蜂巢中如何工作? [英] How does primary key and foreign key constraints works in hive?

查看:70
本文介绍了主键约束和外键约束在蜂巢中如何工作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

主键和外键约束功能可从Hive 2.1版本获得.此约束关系如何在配置单元中工作,与普通数据库中的类似.Hive使用读取时的架构"进行工作,那么这些约束在加载或删除数据时如何产生影响?

Primary key and foreign key constraints feature are available from Hive 2.1 version. How this constraint relation works in the hive, is it similar as in the normal database. Hive works on "Schema on reading", So How these constraints effects while loading or deleting the data?

推荐答案

Hive不验证主键和外键约束.因此,不,它与普通数据库"(例如)不同.在支持约束验证方面,像PostgreSQL这样的RDBMS.

Hive does not validate primary and foreign key contraints. So, no, it is not similar to a "normal database", e.g. an RDBMS like PostgreSQL, in terms of support for constraint validation.

请参考蜂巢文档,其中据说:

自Hive 2.1.0(HIVE-13290)起... Hive包括对未经验证的主键和外键约束的支持.存在约束时,某些SQL工具会生成更有效的查询.由于这些约束未得到验证,因此上游系统需要确保数据完整性,然后再将其加载到Hive中.

As of Hive 2.1.0 (HIVE-13290)... Hive includes support for non-validated primary and foreign key constraints. Some SQL tools generate more efficient queries when constraints are present. Since these constraints are not validated, an upstream system needs to ensure data integrity before it is loaded into Hive.

这篇关于主键约束和外键约束在蜂巢中如何工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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