Skip to content

Commit dffb0c2

Browse files
committed
Add test suggested by @asolimando
1 parent c8effb6 commit dffb0c2

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

datafusion/sqllogictest/test_files/union.slt

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -970,3 +970,23 @@ query TITT
970970
WHEN typ.typtype = 'r' THEN 1
971971
END
972972
----
973+
974+
# Add another row with a non-NULL value `m` which is retained by the
975+
# filter but not matching any WHEN branch m?
976+
query TITT
977+
WITH typ(oid, typnamespace, typname, typtype) AS (
978+
SELECT * FROM (VALUES (1, 10, 't1', 'b'))
979+
UNION ALL SELECT * FROM (VALUES (2, NULL, 't2', 'b'))
980+
UNION ALL SELECT * FROM (VALUES (3, 12, 't3', NULL))
981+
UNION ALL SELECT * FROM (VALUES (4, 40, 't3', 'm'))
982+
), ns(oid, nspname) AS (
983+
VALUES (1, 'ns1'), (2, 'ns2'), (40, 'ns3')
984+
)
985+
SELECT ns.nspname, typ.oid, typ.typname, typ.typtype
986+
FROM typ JOIN ns ON (ns.oid = typ.typnamespace)
987+
WHERE typ.typtype IN ('b','r','m','e','d')
988+
ORDER BY CASE WHEN typ.typtype IN ('b','e','p') THEN 0
989+
WHEN typ.typtype = 'r' THEN 1
990+
END
991+
----
992+
ns3 4 t3 m

0 commit comments

Comments
 (0)