Complex Data Types
Hydrolix supports storing and indexing arrays and maps.
| Type | Description | Indexed by default? | Indexing exceptions | Stored as type | Nullable |
|---|---|---|---|---|---|
| array | An array of any one of the primitive or complex data types supported by Hydrolix | No (can be enabled using configuration) | Array of Arrays, Array of Doubles, Array of Maps |
array |
Yes |
| map | A map containing key/value pairs of primitive or complex data types supported by Hydrolix | Yes | Map of Arrays, Map of Doubles, Map of Maps |
map |
Yes |
In the transform schema, these types have an additional elements object nested under the datatype property. See the example transform schemas for Maps and Arrays.
Elements object⚓︎
The elements object defines the structure of the map or array and the data types it contains. It uses the same settings as the parent object (type, format, index, and other fields) to define how data should be treated.
Map column⚓︎
A map column stores key-value pairs, where keys and values are each a consistent type across all entries in the map.
Map keys and values must be homogeneous types
While key type and value type can differ within a map, all keys and all values stored in a map must be of the same basic or complex type.
Invalid map schemas⚓︎
Valid map schemas⚓︎
Maps are defined as structures containing {key:value} pairs with the key and the value requiring discrete configurations. These example transform schemas define columns of type map.
Sample transform, maps⚓︎
Sample query against map⚓︎
This example queries a map column of type map(string,uint64):
| Map Query: uint64 | |
|---|---|
Arrays⚓︎
An array column stores an ordered collection of values, all of the same type. Arrays are useful for fields that represent multiple values. For example, tags, IP addresses, or event codes. Hydrolix supports arrays of all primitive types and some complex types.
Arrays aren't indexed by default. Indexing can be enabled to accelerate element lookup and whole-array comparison queries. See Indexing and Array operations for details.
Sample transform, arrays⚓︎
Arrays can only store one type
Values stored in an array must all be of the same basic or complex type.
Array of Maps⚓︎
Hydrolix supports the use of the Array of Maps data type. These example transform schemas define columns of type array.
Sample transform, array of maps⚓︎
Indexing⚓︎
Hydrolix indexes columns by default in most cases. Turn off indexing of a column only when necessary. For more information, see the indexing at Hydrolix blog post.
Enable or disable indexing⚓︎
Set "index": true or "index": false in the output columns of the transform schema to enable or disable indexing. For more information about output columns, see Transform Structure. This example demonstrates how to enable or disable indexing:
Array operations⚓︎
Supported index lookup operations⚓︎
| Lookup Type | Array Type | Supported Functions |
|---|---|---|
| Array element lookup (example: arr_column[2] = ‘v1’) |
String | =, like, iLike, in, empty(), isNull(), isNotNull() |
| Integer | =, >, >=, <, <=, in, isNull(), isNotNull() |
|
| Datetime | =, !=, >, >=, <, <=, in, isNull(), isNotNull() |
|
| Array lookup (example: arr_column = [‘v1’, ‘v2’, ‘v3’]) |
All | =, in, empty(), notEmpty(), hasAll(), hasAny(), has() |