v.24.9Experimental Feature
Adds Setting for Inferring Variant Type During Schema Inference
Adds a settinginput_format_try_infer_variantswhich allowsVarianttype to be inferred during schema inference for text formats when there is more than one possible type for column/array elements. #63798 (Shaun Struwig).
Why it matters
This feature addresses the ambiguity when importing text data formats where a column or array element could correspond to more than one data type. By allowing inference of theVariant type in these cases, it improves data ingestion flexibility and accuracy without forcing users to specify schema explicitly.How to use it
Enable the feature by settinginput_format_try_infer_variants to 1 in the session, user, or global settings. This will make ClickHouse automatically infer the Variant type during schema inference for applicable text formats when multiple type possibilities exist.