v.18.16New Feature
DEFAULT Expressions for Missing Fields in Semi-Structured Formats Enabled by insert_sample_with_metadata Setting
DEFAULTexpressions are evaluated for missing fields when loading data in semi-structured input formats (JSONEachRow,TSKV). The feature is enabled with theinsert_sample_with_metadatasetting. #3555
Why it matters
This feature ensures that when data is loaded and certain fields are missing in semi-structured formats, the respectiveDEFAULT expressions are automatically applied. This improves data consistency and simplifies data ingestion workflows by eliminating the need for manual handling of missing values.How to use it
Enable this feature by setting theinsert_sample_with_metadata setting to true during data insertion with formats such as JSONEachRow or TSKV. For example:SET insert_sample_with_metadata = 1;
INSERT INTO table_name FORMAT JSONEachRow ...