summaryrefslogtreecommitdiffstats
path: root/tests/test_transforms.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2022-09-15 16:46:17 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2022-09-15 16:46:17 +0000
commit28cc22419e32a65fea2d1678400265b8cabc3aff (patch)
treeff9ac1991fd48490b21ef6aa9015a347a165e2d9 /tests/test_transforms.py
parentInitial commit. (diff)
downloadsqlglot-28cc22419e32a65fea2d1678400265b8cabc3aff.tar.xz
sqlglot-28cc22419e32a65fea2d1678400265b8cabc3aff.zip
Adding upstream version 6.0.4.upstream/6.0.4
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/test_transforms.py')
-rw-r--r--tests/test_transforms.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/test_transforms.py b/tests/test_transforms.py
new file mode 100644
index 0000000..2030109
--- /dev/null
+++ b/tests/test_transforms.py
@@ -0,0 +1,16 @@
+import unittest
+
+from sqlglot import parse_one
+from sqlglot.transforms import unalias_group
+
+
+class TestTime(unittest.TestCase):
+ def validate(self, transform, sql, target):
+ self.assertEqual(parse_one(sql).transform(transform).sql(), target)
+
+ def test_unalias_group(self):
+ self.validate(
+ unalias_group,
+ "SELECT a, b AS b, c AS c, 4 FROM x GROUP BY a, b, x.c, 4",
+ "SELECT a, b AS b, c AS c, 4 FROM x GROUP BY a, 2, x.c, 4",
+ )