The strict column definition is the more structured way to define a column, and follows the following example form:
columns: { uuidCol: { type: 'uuid' }, mapCol: { type: 'map', keyType: 'text', valueType: 'int' }, listCol: { type: 'list', valueType: 'text' }, vectorCol: { type: 'vector', dimension: 3 },} Copy
columns: { uuidCol: { type: 'uuid' }, mapCol: { type: 'map', keyType: 'text', valueType: 'int' }, listCol: { type: 'list', valueType: 'text' }, vectorCol: { type: 'vector', dimension: 3 },}
In this form, the key is the column name, and the value is an object with a type field that specifies the type of the column.
type
The object may also contain additional fields that are specific to the type of the column:
map
keyType
valueType
'text'
'ascii'
list
set
vector
dimension
service
If you're simply defining a scalar column, you can use the shorthand "loose" syntax instead, which is equivalent to the above for uuidCol:
uuidCol
columns: { uuidCol: 'uuid',} Copy
columns: { uuidCol: 'uuid',}
Overview
The strict column definition is the more structured way to define a column, and follows the following example form:
In this form, the key is the column name, and the value is an object with a
type
field that specifies the type of the column.The object may also contain additional fields that are specific to the type of the column:
map
, you must specify thekeyType
andvalueType
fields.keyType
must, for the time being, be either'text'
or'ascii'
.valueType
must be a scalar type.list
s andset
s, you must specify thevalueType
field.valueType
must be a scalar type.vector
s, you must specify thedimension
field.service
field to enable vectorize.The "loose" shorthand syntax
If you're simply defining a scalar column, you can use the shorthand "loose" syntax instead, which is equivalent to the above for
uuidCol
: