v.24.12Bug Fix

Fixed Type Mismatches After optimize_functions_to_subcolumns Application

Fixed mismatched types in several cases after applying optimize_functions_to_subcolumns. #72394 (Anton Popov).