【原创】大数据基础之Kudu(3)primary key

本文详细解析了Kudu数据库中主键的使用限制,包括主键不可更改、复合主键大小限制、不允许的主键类型及更新约束等,为Kudu用户提供了深入的技术指导。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

关于kudu的primary key

The primary key may not be changed after the table is created. You must drop and recreate a table to select a new primary key.

创建之后主键列不能变更

The columns which make up the primary key must be listed first in the schema.

否则会报错:

ImpalaRuntimeException: Error creating Kudu table 'impala::default.cv00_atty_kudu' CAUSED BY: NonRecoverableException: Got out-of-order key column: name: "ent_ts" type: STRING is_key: true is_nullable: false cfile_block_size: 0

The primary key of a row may not be modified using the UPDATE functionality. To modify a row’s primary key, the row must be deleted and re-inserted with the modified key. Such a modification is non-atomic.

主键列不能被update

Columns with DOUBLE, FLOAT, or BOOL types are not allowed as part of a primary key definition. Additionally, all columns that are part of a primary key definition must be NOT NULL.

double、float、bool类型字段不能作为主键列,同时主键列不能为null

Auto-generated primary keys are not supported.

不支持自动生成主键

Cells making up a composite primary key are limited to a total of 16KB after the internal composite-key encoding done by Kudu.

主键大小最大16k


参考:https://kudu.apache.org/docs/known_issues.html#_schema_and_usage_limitations

转载于:https://www.cnblogs.com/barneywill/p/10701750.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值