1
0
Fork 0

Adding upstream version 20.9.0.

Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
Daniel Baumann 2025-02-13 21:18:57 +01:00
parent 943dfc0887
commit 8a068da99c
Signed by: daniel
GPG key ID: FBB4F0E80A80222F
144 changed files with 78309 additions and 59609 deletions

View file

@ -86,6 +86,15 @@ class TestParser(unittest.TestCase):
self.assertIsNotNone(parse_one("date").find(exp.Column))
def test_structs(self):
cast = parse_one("cast(x as struct<int>)")
self.assertIsInstance(cast.to.expressions[0], exp.DataType)
self.assertEqual(cast.sql(), "CAST(x AS STRUCT<INT>)")
cast = parse_one("cast(x as struct<varchar(10)>)")
self.assertIsInstance(cast.to.expressions[0], exp.DataType)
self.assertEqual(cast.sql(), "CAST(x AS STRUCT<VARCHAR(10)>)")
def test_float(self):
self.assertEqual(parse_one(".2"), parse_one("0.2"))
@ -772,7 +781,7 @@ class TestParser(unittest.TestCase):
)
self.assertEqual(ast.find(exp.Interval).this.sql(), "'71'")
self.assertEqual(ast.find(exp.Interval).unit.assert_is(exp.Var).sql(), "days")
self.assertEqual(ast.find(exp.Interval).unit.assert_is(exp.Var).sql(), "DAYS")
def test_parse_concat_ws(self):
ast = parse_one("CONCAT_WS(' ', 'John', 'Doe')")