v.22.11Improvement

Improve Automatic Structure Detection in Table Functions for ClickHouse

Improve using structure from insertion table in table functions, now setting use_structure_from_insertion_table_in_table_functions has new possible value - 2 that means that ClickHouse will try to determine if we can use structure from insertion table or not automatically. Closes #40028. #42320 (Kruglov Pavel).
Enhancement of the use_structure_from_insertion_table_in_table_functions setting with a new automatic mode to determine the use of the insertion table's structure in table functions.

Why it matters

This feature addresses the need to intelligently decide when to use the structure from the insertion table in table functions, improving usability by allowing ClickHouse to automatically detect if it is applicable. It simplifies configuration and prevents errors caused by manual setting mismatches.

How to use it

Set the use_structure_from_insertion_table_in_table_functions setting to 2 to enable automatic determination of whether to use the insertion table's structure when working with table functions.