diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2023-01-17 10:32:12 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2023-01-17 10:32:12 +0000 |
commit | 244a05de60c9417daab9528b51788c3d2a00dc5f (patch) | |
tree | 89a9c82aa41d397e1b81c320ad7a287b6c80f313 /tests/test_transforms.py | |
parent | Adding upstream version 10.4.2. (diff) | |
download | sqlglot-244a05de60c9417daab9528b51788c3d2a00dc5f.tar.xz sqlglot-244a05de60c9417daab9528b51788c3d2a00dc5f.zip |
Adding upstream version 10.5.2.upstream/10.5.2
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/test_transforms.py')
-rw-r--r-- | tests/test_transforms.py | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/tests/test_transforms.py b/tests/test_transforms.py index cfb8d2b..cc9af7e 100644 --- a/tests/test_transforms.py +++ b/tests/test_transforms.py @@ -1,7 +1,11 @@ import unittest from sqlglot import parse_one -from sqlglot.transforms import eliminate_distinct_on, unalias_group +from sqlglot.transforms import ( + eliminate_distinct_on, + remove_precision_parameterized_types, + unalias_group, +) class TestTime(unittest.TestCase): @@ -62,3 +66,10 @@ class TestTime(unittest.TestCase): "SELECT DISTINCT ON (_row_number) _row_number FROM x ORDER BY c DESC", 'SELECT _row_number FROM (SELECT _row_number, ROW_NUMBER() OVER (PARTITION BY _row_number ORDER BY c DESC) AS _row_number_2 FROM x) WHERE "_row_number_2" = 1', ) + + def test_remove_precision_parameterized_types(self): + self.validate( + remove_precision_parameterized_types, + "SELECT CAST(1 AS DECIMAL(10, 2)), CAST('13' AS VARCHAR(10))", + "SELECT CAST(1 AS DECIMAL), CAST('13' AS VARCHAR)", + ) |