SMALLINT is a signed 16-bit ScyllaDB integer type. It stores whole numbers from -32,768 through 32,767, giving it more range than TINYINT while using less space than DATE for compact numeric values. section 4.2.2 section 5.1.3
Use SMALLINT when the value is an integer and its bounded range fits the requirement:
- Represent compact counters or codes that may exceed TINYINT but remain below 32,768. section 4.2.2
- Use it for time buckets such as the number of months since an application launched; it provides substantial room to grow. section 5.1.3
- Prefer DATE when the bucket's meaning should be immediately clear; translate the numeric bucket in application code when needed. section 5.1.3
Insert and read a SMALLINT
A row can store 10000 as SMALLINT and return the same value when queried. ScyllaDB validates integer bounds and rejects values outside the selected type's range.
Table 4.4 The four integer types in CQL
|
Type
|
Size
|
Minimum value
|
Maximum value
|
|---|---|---|---|
TINYINT
|
8-bit
|
-128
|
127
|
SMALLINT
|
16-bit
|
-32,768
|
32,767
|
INT
|
32-bit
|
-2,147,483,648
|
2,147,483,647
|
BIGINT
|
64-bit
|
-9,223,372,036,854,775,808
|
9,223,372,036,854,775,807
|
Compare SMALLINT with TINYINT, INT, and BIGINT by bit width and minimum and maximum values. section 4.2.2


