Type Reference
The PostgreSQL Type column shows the literal type Datris emits in the generatedCREATE TABLE DDL. Datris remaps only a few types to their canonical Postgres aliases (tinyint/smallint → int2, float → float4, double → float8, string → text); every other type is emitted verbatim.
Precision and Scale for Decimal
Thedecimal(p,s) type requires two parameters:
- p (precision): total number of digits, range 1 to 38.
- s (scale): number of digits to the right of the decimal point, range 0 to p.
Integer Type Selection
Choose the narrowest integer type that fits your data to reduce storage and improve Spark performance:String Type Selection
All three string types map to
StringType in Spark. The length constraint is enforced only at the PostgreSQL layer.
JSON and XML Special Types
JSON and XML pipelines are semi-structured: the source schema must contain exactly one field, named literally_json or _xml (matching the source file type), with type string. The validator rejects any schema with a different field count or a different field name.
Declare the single field with type
string in the schema:
_xml field. During ingestion, the pipeline preserves the raw content without attempting to parse it into individual columns. This is useful for semi-structured data that should be queried with JSON or XML functions downstream.
Type Coercion
During ingestion, the pipeline converts field values from strings to the declared type:- Null or empty string — passed through unchanged (no type conversion is applied). The Postgres
COPYlayer then converts an empty field toNULL. - Numeric types (
int,bigint,float,double,decimal, etc.) — the value is parsed using Scala’s built-in conversion.decimalis parsed viatoDoublein the row-map path. If parsing fails (e.g.,"abc"in anintcolumn), the job fails with an error. - String types (
string,varchar,char) — stored as-is with no conversion. - Date and timestamp — stored as the raw string value. The destination (PostgreSQL, Spark) handles date/timestamp parsing according to its own rules.
