Skip to content

Concepts

Types

SQLLoad's portable column types, how each maps to Snowflake, Databricks, BigQuery, ClickHouse, Postgres, DuckDB and Parquet, and how source types are read.

SQLLoad describes columns in a small set of portable types. You write them in columns, plan shows them next to each warehouse type, and the same declarations work for every destination.

[sources.app.tables."public.orders"]
description = "Orders, one row per order."
columns = { total = "decimal(18,2)", closes_at = "timestamp_tz" }
Type Snowflake Databricks BigQuery ClickHouse Postgres DuckDB Parquet (Arrow)
bool BOOLEAN BOOLEAN BOOL Bool boolean BOOLEAN Boolean
smallint NUMBER(38,0) ¹ SMALLINT INT64 ¹ Int16 smallint SMALLINT Int16
int (64-bit) NUMBER(38,0) BIGINT INT64 Int64 bigint BIGINT Int64
decimal(p,s) NUMBER(p,s) DECIMAL(p,s) NUMERIC(p,s) ² Decimal(p, s) numeric(p,s) DECIMAL(p,s) Decimal128(p,s)
float (64-bit) FLOAT DOUBLE FLOAT64 Float64 double precision DOUBLE Float64
text VARCHAR STRING STRING String text VARCHAR Utf8
varchar(n) VARCHAR(n) STRING ¹ STRING(n) String ¹ varchar(n) VARCHAR ¹ Utf8
date DATE DATE DATE Date32 ¹ date DATE Date32
time TIME(9) STRING ¹ TIME String ¹ time TIME Time64
timestamp_tz TIMESTAMP_TZ(9) TIMESTAMP ¹ TIMESTAMP ¹ DateTime64(6, 'UTC') ¹ timestamptz ¹ TIMESTAMP WITH TIME ZONE ¹ Timestamp(UTC)
timestamp_ntz TIMESTAMP_NTZ(9) TIMESTAMP_NTZ DATETIME DateTime64(6) ¹ timestamp TIMESTAMP Timestamp
json VARIANT VARIANT JSON String ¹ jsonb ¹ JSON ⁴ Utf8
uuid VARCHAR(36) ¹ STRING ¹ STRING ¹ UUID uuid UUID Utf8
binary BINARY BINARY BYTES String bytea BLOB Binary
native("...") passed through passed through passed through passed through passed through passed through not available
array(T) ³ ARRAY ¹ ARRAY<T> ARRAY<T> ¹ Array(T) ¹ T[] T[] List(T)

¹ Held with a loss, which plan notes. Besides what the table shows, timestamp_tz keeps its instant but not its offset; ClickHouse holds dates and timestamps from 1900 to 2299 (a date outside fails the load) and shows timestamp_ntz in the server’s time zone; Postgres jsonb keeps neither key order nor duplicate keys. For ClickHouse’s JSON type, pin native("JSON").

² BIGNUMERIC(p,s) for more than 29 digits before the point or a scale over 9. decimal(p,p) is created as NUMERIC(p+1,p), as NUMERIC keeps a digit before the point, and reads back as decimal(p+1,p).

³ See Arrays.

⁴ VARIANT with json_type = "variant" on the target. See VARIANT columns.

Every ClickHouse column is Nullable, such as Nullable(Int64).

native("GEOGRAPHY") passes a warehouse type through unchanged; SQLLoad doesn’t widen or convert it. plan refuses a native type for a files target, for any source’s constant_columns, and for a files source’s partition_columns and path_columns.

array(T) is a list of one portable type, such as array(int) or array(decimal(10,2)). T is bool, smallint, int, float, decimal(p,s), text, date, timestamp_tz, timestamp_ntz or uuid; anything else, including nested arrays, is refused.

You pin an array in columns; without a pin, lists load as json. Pinning an array over a column that already holds json (a Snowflake VARIANT too) fails plan; recreate it with --reload.

[sources.app.tables."public.items"]
description = "Items, one row per item."
columns = { tags = "array(text)", prices = "array(decimal(10,2))" }
Destination Stored as What it can’t hold
DuckDB, Postgres T[] Nothing; NULL arrays, empty arrays and NULL elements stay apart.
Databricks ARRAY<T> Nothing.
Parquet List(T) Nothing.
ClickHouse Array(Nullable(T)) NULL arrays: they load empty.
BigQuery ARRAY<T> NULLs: a NULL array loads empty; a NULL element fails the load. array(timestamp_tz) is refused; use array(timestamp_ntz).
Snowflake ARRAY Typed elements: each is a JSON value, so decimals, dates, timestamps and uuids are strings, such as "1.50". NaN and infinities fail the load; pin array(text).

Postgres arrays, Parquet lists, JSON arrays (in JSON files or CSV fields) and Python lists can all be pinned as arrays. Each element converts as a pinned column of T would: one that doesn’t fit exactly, such as "abc" or 1.5 in an array(int), fails the load, naming it, and so does a value that isn’t a list. For NaN and infinities from Python, see NaN and infinities. Partition, path and constant columns, and Postgres change capture, don’t take arrays.

Type names are parsed strictly. An unknown or malformed name fails plan with the nearest valid one. These aliases mean the same everywhere:

Written Means
integer, bigint int
boolean bool
string, varchar, character varying text
double, double precision float
numeric(p,s) decimal(p,s)
timestamp with time zone timestamp_tz
timestamp without time zone, datetime timestamp_ntz
varbinary binary

decimal needs a precision, such as decimal(18,2); decimal(10) is decimal(10,0).

A warehouse’s own names, such as Snowflake’s NUMBER or Postgres’s jsonb, work only when every destination of the table is that warehouse, and mean the portable type they hold: Snowflake’s NUMBER(38,0) is decimal(38,0), not int, and ARRAY is json. Declare arrays as array(T), and ClickHouse and Parquet columns by their portable type, not Nullable(...) or an Arrow type.

timestamp is timestamp_tz in BigQuery and Databricks and timestamp_ntz in Postgres and DuckDB; Snowflake (which follows the account’s TIMESTAMP_TYPE_MAPPING) and other destinations refuse it. It works when all of a table’s destinations read it alike; otherwise:

"TIMESTAMP" is timestamp_tz in BigQuery, but timestamp_ntz in DuckDB and Postgres; use "timestamp_tz" (with a time zone) or "timestamp_ntz" (without)

bignumeric(p,s) is decimal(p,s), with p up to 38, for BigQuery only. A BIGNUMERIC without a precision has more digits than any decimal, so it is refused.

Name Use instead
timestamp_ltz timestamp_tz (it depends on each session’s time zone)
real float (64-bit)
tinyint smallint
char, character text or varchar(n) (they pad with spaces)
Postgres Portable type
boolean, smallint, text, varchar(n), date, time, uuid The same type
integer, bigint, oid int
real, double precision float
numeric(p,s) decimal(p,s)
numeric without a precision None: plan asks you to pin one, such as decimal(38,10) or text.
timestamp, timestamptz timestamp_ntz, timestamp_tz
json, jsonb json
bytea binary
arrays json, or array(T) when pinned
others (enums, interval, network types, timetz, extensions) text

A pinned column is read as its pinned type, when the source type can be read that way.

Python values are typed as the Python API describes. Parquet columns keep their Arrow types. CSV and JSON columns are inferred from a sample of records; pin any you want typed differently. On every source, a value a pinned decimal(p,s) or integer can’t hold exactly, such as 12.345 in decimal(10,2), fails the read, naming the column and value, rather than rounding.

infer_types = false on a source or table loads every column SQLLoad would infer as text: from files other than Parquet, Google Sheets, and dict rows of Python tables and transforms. Use it for codes that are numeric in some rows and not others, such as 1099999500115812 and 16ZN102RSC, or that must keep leading zeros. Pinned columns keep their types:

[sources.products]
kind = "files"
path = "drop/products/"
format = "csv"
infer_types = false
[sources.products.tables.products]
columns = { price = "decimal(18,2)", updated = "date" }

Each value loads as written: a CSV field, a Google Sheets cell’s shown text, a JSON number, a Python dict value such as true or 1.5. Objects and lists stay json, so flatten and unnest work as usual (unnest child tables still infer). It applies to CSV, JSON, NDJSON, Excel and XML files, Google Sheets, and Python dict rows; Parquet, Arrow data and databases keep their types. plan shows it on the schema line:

├── schema every column text except columns pinned, objects and lists (infer_types = false)

On an existing table, the inferred columns change to text as type_change_rebuild allows; values already loaded become their text.

A table’s parse reads text columns as times, on every source. Each column lists its formats; each value takes the first that reads it.

[sources.orders]
kind = "files"
connection = "lake"
path = "drop/orders/"
format = "csv"
description = "Orders, one file a month."
write_strategy = "append"
timezone = "Europe/Paris"
[sources.orders.tables.orders.parse]
"Updated At".timestamp = [
"iso", "%m/%d/%Y %H:%M:%S", "%m/%d/%Y %H:%M", "%m/%d/%Y",
]
due = { date = "%d.%m.%Y", on_error = "null" }
Loads (1) sqlload load
└── raw.orders append
…
├── parse due date from "%d.%m.%Y"; a value no format reads loads NULL
│ updated_at timestamp_tz from iso, "%m/%d/%Y %H:%M:%S", "%m/%d/%Y %H:%M", "%m/%d/%Y"; times without an offset in Europe/Paris (the source's timezone)
…
Key Meaning
timestamp A format, or a list tried in turn. Loads as timestamp_tz, stored as UTC.
date A format, or a list tried in turn. Loads as date.
tz With timestamp: the IANA zone, such as "Europe/Paris", of times without an offset.
on_error "fail" (default) or "null": what a value no format reads does.

A format is one of:

  • "iso": ISO 8601, a date, then optionally T or a space and HH:MM, HH:MM:SS or HH:MM:SS.ffffff, then optionally Z or an offset (+01:00, +0100, +01). Under date, it reads YYYY-MM-DD only.
  • A strftime format, such as "%m/%d/%Y %H:%M". Write a fraction of a second as %.f; Python’s %f is refused, and so is %s (write "epoch_s"). An offset is %z, or %#z to take Z too.
  • "epoch_s", "epoch_ms" or "epoch_us": a number or numeric text counting from 1970-01-01 UTC. It may be in a timestamp list or the whole entry, as in parse = { created = "epoch_ms" }.

A time without an offset is read in the column’s tz, else the table’s or source’s timezone, else UTC; plan names which. Above, 2026-03-29T01:30:00 loads as 2026-03-29 00:30:00+00 and 03/30/2026 as 2026-03-29 22:00:00+00 (a date alone is midnight). A value with an offset keeps its instant, whatever tz says. A time the clocks skip, such as 02:30 in Paris on 29 March 2026, fails (or loads NULL with on_error = "null"); a time that happens twice takes the earlier instant.

A value no format reads fails the load, naming the row, the column and the value:

failed raw.orders 2026-03.csv: ./drop/orders/2026-03.csv row 3: column due holds "soon", which is not a date in the format "%d.%m.%Y"; fix the value, or set on_error = "null" in its parse to load NULL

A parse key is a column’s loaded or source name, as in columns. It applies after transform, flatten, naming and rename. plan refuses an unknown column, one also pinned in columns, an unreadable format, and a zone that isn’t IANA:

Errors (3)
├── raw.orders
│ └── reason parse "updated" is not a column of the source table (names are case-sensitive); did you mean "updated_at"?
├── raw.orders
│ └── reason parse due: format "%d.%m.%Q" has a directive that is not a strftime one such as %Y, %m, %d, %H, %M, %S or %z
└── raw.orders
└── reason timezone: "Europe/Pari" is not an IANA time zone such as "Europe/Paris" or "America/New_York"

parse reads text, and numbers with an epoch format. A column the source already types as a date or time has nothing to parse: plan refuses it on a database source, and the load fails on a Python datetime. Drop its parse. Number formats such as 1,234.5 belong in a transform.

A Python table takes the same entries as @source.table(parse={...}, timezone="Europe/Paris"); an sl.http job’s sl.field(parse=...) takes them for one field. A files table with parse is read by SQLLoad, never by the destination itself.