v.24.3Improvement

Always Infer Exponential Numbers in JSON and Introduce String Type for Ambiguous Paths in Named Tuples Inference

Always infer exponential numbers in JSON formats regardless of the setting input_format_try_infer_exponent_floats. Add setting input_format_json_use_string_type_for_ambiguous_paths_in_named_tuples_inference_from_objects that allows to use String type for ambiguous paths instead of an exception during named Tuples inference from JSON objects. #60808 (Kruglov Pavel).
Always infer exponential numbers in JSON inputs regardless of the input_format_try_infer_exponent_floats setting. Introduce a new setting input_format_json_use_string_type_for_ambiguous_paths_in_named_tuples_inference_from_objects to use String type for ambiguous paths instead of throwing an exception during named Tuple inference from JSON objects.

Why it matters

This feature ensures that exponential notation numbers in JSON are consistently inferred as numbers regardless of previous settings, improving reliability of data parsing. Additionally, it prevents errors caused by ambiguous paths during named Tuple inference by allowing users to opt for String type fallback. This enhances robustness and flexibility when importing JSON data containing complex or uncertain structures.

How to use it

To always infer exponential numbers, no action is needed as this behavior is now default and independent of input_format_try_infer_exponent_floats. To avoid exceptions caused by ambiguous paths in named Tuple inference, set the configuration option:

SET input_format_json_use_string_type_for_ambiguous_paths_in_named_tuples_inference_from_objects = 1;


This will force ambiguous paths to be treated as String types during JSON imports.