v.23.1Improvement

Refactor Schema Inference for Text Formats with Nullable Columns Setting

Refactor and improve schema inference for text formats. Add new setting schema_inference_make_columns_nullable that controls making result types Nullable (enabled by default);. #44019 (Kruglov Pavel).
Refactor and enhance schema inference for text formats in ClickHouse. Introduce a new setting schema_inference_make_columns_nullable that controls whether inferred column types are made Nullable by default.

Why it matters

This feature improves the accuracy and flexibility of schema inference when importing text data formats by allowing nullable types. It helps prevent data import errors due to non-nullable columns and provides better compatibility with datasets containing missing or null values.

How to use it

Users can control the nullability of inferred columns by setting schema_inference_make_columns_nullable to true or false. The setting is enabled (true) by default, making all inferred column types nullable. To disable this behavior, set the option to false in the configuration or session settings.