diff options
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)", + ) |