Towards an Error-free UNION ALL

This is a companion discussion topic for the original entry at Towards an Error-free UNION ALL | dbt Developer Blog

Just wanted to let you know that the example code for union_relations is missing array closure " ] " here => Towards an Error-free UNION ALL | dbt Developer Blog

Hi,

Is there dbt magic to solve the issue when unioning 2 tables with same column names that have different types? The Matillion “Unite” component does it remarkably well.

Yes, union_relations will handle type conversion as well where possible!

Is it possible to union CTEs?

No, because the macro needs to introspect the information_schema tables to see which columns exist and their data types.