Typecast

EventNative doesn't require you to configure data schema. It will be determined from default types, configurable mappings, input data, and already existing destination columns.

Default types

At present there are several default typecast rules:

Field

Type

Description

_timestamp

timestamp

System field inserting by EventNative backend

eventn_ctx_utc_time

timestamp

Default field inserting by EventNative js

Configurable mappings

You can configure field typecast in the mapping config section - see Schema and Mappings.

From input data

EventNative detects data types from values within one batch before creating a table or patching table with a new column. In case when one field has several value types the result type will be calculated by finding the lowest common ancestor in typecast tree:

Typecast tree
‚Äč
STRING(3)
/ \
FLOAT64(2) TIMESTAMP(4)
/
INT64(1)

For example, in the following json batch field salary will have FLOAT64 type and field id will have STRING type.

{"id": "1", "name": "John","salary": 20000, "currency": "USD"}
{"id": 2, "name": "Sarah","salary": 20000.5, "currency": "USD"}

From existing destination columns

EventNative doesn't change existing destination column types, therefore, all fields which exist in the destination will be cast to the destination column type. For changing destination column type you can apply mapping for moving field to a new field or create a new partition or a new table.