Skip to content

Instantly share code, notes, and snippets.

@tom-clickhouse
Created October 18, 2024 07:27
Show Gist options
  • Save tom-clickhouse/c30b287d0a4a514b1019fcbed1584467 to your computer and use it in GitHub Desktop.
Save tom-clickhouse/c30b287d0a4a514b1019fcbed1584467 to your computer and use it in GitHub Desktop.
Dynamic type with max_types parameter
SET allow_experimental_dynamic_type = 1;
CREATE OR REPLACE TABLE test
(
c Dynamic(max_types=3)
)
ENGINE = MergeTree
ORDER BY tuple()
SETTINGS
min_bytes_for_wide_part = 1,
min_rows_for_wide_part = 1;
INSERT INTO test values
(42),
('foo'),
([23, 24]),
('2020-01-01'),
(43),
(NULL),
(FALSE),
(['bar', 'baz']),
([25]),
('2020-01-02'),
(44),
(TRUE),
(''),
([26, 27]);
SELECT * FROM test;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment