Databases
Cassandra
Column Types

Cassandra Column Types

SchemaHero supports Cassandra's native data types. If a type is missing, open an issue (opens in a new tab).

Numeric Types

TypeDescription
tinyint1-byte signed integer
smallint2-byte signed integer
int4-byte signed integer
bigint8-byte signed integer
varintArbitrary-precision integer
float4-byte floating point
double8-byte floating point
decimalVariable-precision decimal
counterDistributed counter

Text Types

TypeAliasesDescription
textvarcharUTF-8 encoded string
asciiASCII string

Note: SchemaHero normalizes varchar to text.

UUID and Time Types

TypeDescription
uuidUUID (any version)
timeuuidType 1 UUID (time-based)
timestampDate and time (millisecond precision)
dateDate without time
timeTime without date (nanosecond precision)
durationDuration (months, days, nanoseconds)

Binary and Boolean

TypeDescription
blobArbitrary bytes
booleanTrue/false

Network Types

TypeDescription
inetIP address (IPv4 or IPv6)

Collection Types

TypeExampleDescription
list<type>list<text>Ordered collection
set<type>set<int>Unordered unique collection
map<k,v>map<text, text>Key-value pairs

Frozen Collections

Use frozen<> for nested collections or UDTs:

columns:
  - name: addresses
    type: frozen<list<frozen<address>>>
  - name: metadata
    type: frozen<map<text, text>>

Tuple Type

columns:
  - name: coordinates
    type: tuple<double, double>
  - name: full_name
    type: tuple<text, text, text>

User-Defined Types (UDT)

Reference UDTs by name after creating them:

columns:
  - name: address
    type: frozen<address>
  - name: contact
    type: frozen<contact_info>

Static Columns

Mark columns as static for wide-row patterns:

columns:
  - name: user_name
    type: text
    isStatic: true

Counter Columns

Counter tables have special rules:

  • Primary key columns only
  • All non-primary-key columns must be counter
  • Cannot mix counter and non-counter columns
columns:
  - name: page_id
    type: uuid
  - name: view_count
    type: counter
  - name: click_count
    type: counter

Examples

columns:
  # Primary key columns
  - name: tenant_id
    type: uuid
  - name: user_id
    type: timeuuid
  
  # Regular columns
  - name: email
    type: text
  - name: age
    type: int
  - name: balance
    type: decimal
  - name: active
    type: boolean
  - name: last_login
    type: timestamp
  
  # Collections
  - name: tags
    type: set<text>
  - name: scores
    type: list<int>
  - name: properties
    type: map<text, text>
  
  # Static column
  - name: account_name
    type: text
    isStatic: true