Skip to content

Instantly share code, notes, and snippets.

@tom-clickhouse
Created October 18, 2024 07:23
Show Gist options
  • Save tom-clickhouse/cba68ca35a5926d2145a186bec695d73 to your computer and use it in GitHub Desktop.
Save tom-clickhouse/cba68ca35a5926d2145a186bec695d73 to your computer and use it in GitHub Desktop.
Dynamic type
SET allow_experimental_dynamic_type = 1;
CREATE OR REPLACE TABLE test
(
c Dynamic
)
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]),
(43),
(NULL),
([25]),
(44),
(''),
([26, 27]);
SELECT * FROM test;
@sundeepChandhoke
Copy link

Would it be possible for you to share an example showing how one can configure a Kafka Table using Protobuf encoding with a dynamic JSON column. Can the protobuf interpret a string and convert to dynamic JSON column automatically, or is there a configuration I need to add to the table to indicate that the string should be converted to JSON or to the materialized view when moving it to a storage table? Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment