This is a Jitsu.Classic documentation. For the lastest version, please visit docs.jitsu.com. Read about differences here.

šŸ“œ Configuration

Configuration UI

šŸ‘©ā€šŸ”¬ Extending Jitsu

Overview
Destination Extensions
Source Extensions
API Specs

Jitsu Internals

Jitsu Server

Typecast

Jitsu doesn't require you to configure data schema for destination database. Data types will be determined from input data unless explicit data types are configured in mapping section.

Default types

At present there are two default typecast rules:

FieldTypeDescription
_timestamptimestampSystem field inserting by Jitsu Server
_utc_timetimestampDefault field inserting by Jitsu JS SDK

Configurable mappings

You can configure field SQL type in the mapping config section - see Schema and Mappings. All fields with explicit SQL types from mapping rules will be explicitly cast with DWH typecast operators in SQL statements. For example, Postgres SQL insert with explicit SQL types:

INSERT INTO schema.table (id, name, salary, currency)
VALUES ('1'::bigint, 'John', '20000'::numeric(38,18), 'USD')

From input data

Jitsu detects data types from values within one batch before creating a table or patching a 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 the following typecast tree:

Typecast tree

  STRING(4)
  /       \
     FLOAT64(3)  TIMESTAMP(5)
/
    INT64(2)
      /
    BOOL(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"}

BOOL, INT64, FLOAT64, STRING, TIMESTAMP - are inner data types that will be mapped into DWH SQL types according to the following table:

Data WarehouseBOOLINT64FLOAT64STRINGTIMESTAMP
Postgresbooleanbigintnumeric(38,18)texttimestamp
Redshiftbooleanbigintnumeric(38,18)character varying(65535)timestamp
BigQuerybooleanintegerfloatstringtimestamp
ClickHouseUInt8Int64Float64StringDateTime
Snowflakebooleanbigintnumeric(38,18)texttimestamp(6)
MySQLbooleanbigintdecimal(38,18)textdatetime