Skip to content

Instantly share code, notes, and snippets.

@fpopic
Last active October 21, 2019 20:14
Show Gist options
  • Save fpopic/56449b3f51ec07a7aa10e9db90a300df to your computer and use it in GitHub Desktop.
Save fpopic/56449b3f51ec07a7aa10e9db90a300df to your computer and use it in GitHub Desktop.
WITH
T_A AS (
SELECT STRUCT("1" AS x, 2 AS y) a -- schema a is huge
),
T_B AS(
SELECT STRUCT(TRUE AS z, 4.0 AS w) b -- schema b is huge as well
)
SELECT
a,
NULL b
FROM
T_A
UNION ALL
SELECT
NULL a,
b
FROM
T_B
# Wanted output:
# (1 x, 2 y) a, NULL b
# NULL a, (TRUE z, 4,0 w) b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment