Skip to content

Commit c4e7de3

Browse files
lohanidamodarclaude
andcommitted
docs(readme): drop Nullable(Array/Tuple) example that the compiler rejects
ClickHouse does not allow Nullable(Array(...)); the schema compiler throws UnsupportedException pointing callers at the empty-array sentinel. Nullable(Tuple(...)) is also rejected because ClickHouse marks it experimental behind allow_experimental_nullable_tuple_type and recommends Tuple(Nullable(T1), Nullable(T2), ...) instead. Remove the incorrect ->array('scores', ...)->nullable() example and its expected SQL, and rewrite the surrounding prose to document both constraints accurately. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 3dff874 commit c4e7de3

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

README.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2298,17 +2298,15 @@ $schema->table('events')
22982298
->array('meta.value', ColumnType::String)
22992299
->array('user_ids', ColumnType::BigInteger)->unsigned()
23002300
->tuple('coords', [ColumnType::Float, ColumnType::Float])
2301-
->array('scores', ColumnType::String)->nullable()
23022301
->create();
23032302

23042303
// CREATE TABLE `events` (`id` Int64,
23052304
// `meta.key` Array(String), `meta.value` Array(String),
23062305
// `user_ids` Array(UInt64),
2307-
// `coords` Tuple(Float64, Float64),
2308-
// `scores` Nullable(Array(String))) ENGINE = MergeTree() ORDER BY (`id`)
2306+
// `coords` Tuple(Float64, Float64)) ENGINE = MergeTree() ORDER BY (`id`)
23092307
```
23102308

2311-
The element type runs back through the standard column-type compiler, so the parent column's `unsigned()` and `precision` flags carry through to the inner type. `Nullable(...)` wraps the whole `Array`/`Tuple`; `LowCardinality(...)` is rejected on these columns because ClickHouse only permits it on scalar types. Both methods are only available on the ClickHouse builder.
2309+
The element type runs back through the standard column-type compiler, so the parent column's `unsigned()` and `precision` flags carry through to the inner type. `LowCardinality(...)` is rejected on these columns because ClickHouse only permits it on scalar types. `Nullable(Array(...))` is also rejected — use an empty array `[]` as the missing-value sentinel. `Nullable(Tuple(...))` is rejected for the same reason (ClickHouse marks it experimental and gates it behind `allow_experimental_nullable_tuple_type`); use `Tuple(Nullable(T1), Nullable(T2), ...)` instead. Both `array()` and `tuple()` are only available on the ClickHouse builder.
23122310

23132311
**`decimal(precision, scale)`** — fixed-point numeric column for monetary or precision-sensitive values where binary floating-point error is unacceptable:
23142312

0 commit comments

Comments
 (0)