summaryrefslogtreecommitdiffstats
path: root/tests/test_lineage.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2023-07-24 08:03:48 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2023-07-24 08:03:48 +0000
commit36db14f4c6c28209371d563d76697df0172e337f (patch)
tree527347be54a38fc9b14fe1fa04c27a4bbae44016 /tests/test_lineage.py
parentReleasing debian version 17.4.1-1. (diff)
downloadsqlglot-36db14f4c6c28209371d563d76697df0172e337f.tar.xz
sqlglot-36db14f4c6c28209371d563d76697df0172e337f.zip
Merging upstream version 17.7.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/test_lineage.py')
-rw-r--r--tests/test_lineage.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/test_lineage.py b/tests/test_lineage.py
index f33a2c2..0fd9da8 100644
--- a/tests/test_lineage.py
+++ b/tests/test_lineage.py
@@ -186,3 +186,16 @@ class TestLineage(unittest.TestCase):
self.assertEqual(downstream.alias, "")
self.assertEqual(downstream.downstream, [])
+
+ def test_lineage_union(self) -> None:
+ node = lineage(
+ "x",
+ "SELECT ax AS x FROM a UNION SELECT bx FROM b UNION SELECT cx FROM c",
+ )
+ assert len(node.downstream) == 3
+
+ node = lineage(
+ "x",
+ "SELECT x FROM (SELECT ax AS x FROM a UNION SELECT bx FROM b UNION SELECT cx FROM c)",
+ )
+ assert len(node.downstream) == 3