Schema design limitations
Kudu currently has some known limitations that may factor into schema design.
Primary key
-
The primary key cannot 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.
-
The primary key of a row cannot 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. -
Columns with
DOUBLE
,FLOAT
, orBOOL
types are not allowed as part of a primary key definition. Additionally, all columns that are part of a primary key definition must beNOT NULL
. -
Auto-generated primary keys are not supported.
-
Cells making up a composite primary key are limited to a total of 16KB after internal composite-key encoding is done by Kudu.
Cells
No individual cell may be larger than 64KB before encoding or compression. The cells making up a composite key are limited to a total of 16KB after the internal composite-key encoding done by Kudu. Inserting rows not conforming to these limitations will result in errors being returned to the client.
Columns
-
By default, Kudu tables can have a maximum of 300 columns. We recommend schema designs that use fewer columns for best performance.
-
CHAR
,DATE
, and complex types such asARRAY
,MAP
, andSTRUCT
are not supported. -
Type, nullability, and type attributes (i.e. precision and scale of
DECIMAL
, length ofVARCHAR
) of the existing columns cannot be changed by altering the table. -
Dropping a column does not immediately reclaim space. Compaction must run first.
Tables
-
Tables must have an odd number of replicas, with a maximum of 7.
-
Replication factor (set at table creation time) cannot be changed.
-
There is no way to run compaction manually, but dropping a table will reclaim the space immediately.
Other usage limitations
-
Secondary indexes are not supported.
-
Multi-row transactions are not supported.
-
Relational features, such as foreign keys, are not supported.
-
Identifiers such as column and table names are restricted to be valid UTF-8 strings. Additionally, a maximum length of 256 characters is enforced.
If you are using Apache Impala to query Kudu tables, refer to the section on Impala integration limitations as well.