v.22.4Improvement

Support Schema Inference for Insert Select with Input Table Function

Support schema inference for insert select with using input table function. Get schema from insertion table instead of inferring it from the data in case of insert select from table functions that support schema inference. Closes #35639. #35760 (Kruglov Pavel).
Support schema inference for INSERT SELECT statements using the input table function by deriving the schema from the insertion table instead of the data source.

Why it matters

This feature addresses the problem of schema inference when performing INSERT SELECT operations from table functions that support schema inference, such as input. Instead of inferring the schema based on the input data, which may be unreliable or ambiguous, the schema is directly obtained from the target insertion table. This ensures consistency and correctness in schema determination during insertion, improving user experience and reducing errors.

How to use it

When performing an INSERT SELECT operation from a table function like input, the schema will automatically be inferred from the destination table's schema. No additional configuration is required from the user to enable this behavior.