User-Defined Types

The Simba Cassandra JDBC Connector can be configured to provide support for Cassandra user-defined types by flattening the underlying subtypes into their own individual columns in the table. Specifically, user-defined types are supported as base data or as part of a collection. For information about enabling this feature, see FlattenUDTColumn.

The column names for user-defined types are constructed in the following format:

[Column_name]_[Subtype_name]

Where:

  • [Column_name] is the name of column that contains the user-defined type.
  • [Subtype_name] is the name of the subtype in the user-defined type.

For example, a user-defined type that contains a user's full name is created as follows:

CREATE TYPE fullname

(first_name text, last_name text)

The connector creates a table that contains two columns, id:text and name:fullname. The connector then reads the data from this table as follows:

"id", "name_first_name", "name_last_name"

"a", "Chris", "Kwan"