v.23.7Improvement

Fix use_structure_from_insertion_table_in_table_functions for MATERIALIZED and ALIAS columns

Fix use_structure_from_insertion_table_in_table_functions does not work with MATERIALIZED and ALIAS columns. Closes #51817. Closes #51019. #51825 (flynn).
Fix the use_structure_from_insertion_table_in_table_functions setting to properly work with MATERIALIZED and ALIAS columns in table functions.

Why it matters

This fix addresses the issue where the use_structure_from_insertion_table_in_table_functions setting did not correctly interpret the structure of tables containing MATERIALIZED and ALIAS columns. It ensures that these special column types are now recognized and handled properly, improving table function behavior and data consistency when these columns are involved.

How to use it

To enable the fix, simply use the use_structure_from_insertion_table_in_table_functions setting as before. This update ensures that when enabled, the structure resolution now includes MATERIALIZED and ALIAS columns automatically without any additional configuration.