TVE and Function expression resolution for temp tables, partitioning improvements