v.22.8New Feature

Add Settings for Schema Inference from Text Formats

Add new settings to control schema inference from text formats: - input_format_try_infer_dates - try infer dates from strings. - input_format_try_infer_datetimes - try infer datetimes from strings. - input_format_try_infer_integers - try infer Int64 instead of Float64. - input_format_json_try_infer_numbers_from_strings - try infer numbers from json strings in JSON formats. #39186 (Kruglov Pavel).
Added new settings in ClickHouse to control schema inference from text formats, enabling more precise automatic detection of data types like dates, datetimes, and integers.

Why it matters

This feature improves ClickHouse's ability to automatically infer data types when importing data from text formats. It allows users to fine-tune how dates, datetimes, and numbers are detected and parsed, reducing the need for manual schema definition and preventing data type misinterpretation.

How to use it

Users can enable or configure the feature by setting the following parameters during input data processing:

input_format_try_infer_dates = 1         -- to infer date columns from strings
input_format_try_infer_datetimes = 1 -- to infer datetime columns from strings
input_format_try_infer_integers = 1 -- to infer Int64 instead of Float64 for numbers
input_format_json_try_infer_numbers_from_strings = 1 -- to infer numbers from JSON strings in JSON formats

Set these settings in your session or query context to control schema inference behavior.