Adding upstream version 22.2.0.
Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
parent
b01402dc30
commit
f1aa09959c
148 changed files with 68457 additions and 63176 deletions
|
@ -249,7 +249,7 @@ class TestExpressions(unittest.TestCase):
|
|||
{"example.table": "`my-project.example.table`"},
|
||||
dialect="bigquery",
|
||||
).sql(),
|
||||
'SELECT * FROM "my-project".example.table /* example.table */',
|
||||
'SELECT * FROM "my-project"."example"."table" /* example.table */',
|
||||
)
|
||||
|
||||
def test_expand(self):
|
||||
|
@ -313,6 +313,18 @@ class TestExpressions(unittest.TestCase):
|
|||
).sql(),
|
||||
"SELECT * FROM (SELECT a FROM tbl1) WHERE b > 100",
|
||||
)
|
||||
self.assertEqual(
|
||||
exp.replace_placeholders(
|
||||
parse_one("select * from foo WHERE x > ? AND y IS ?"), 0, False
|
||||
).sql(),
|
||||
"SELECT * FROM foo WHERE x > 0 AND y IS FALSE",
|
||||
)
|
||||
self.assertEqual(
|
||||
exp.replace_placeholders(
|
||||
parse_one("select * from foo WHERE x > :int1 AND y IS :bool1"), int1=0, bool1=False
|
||||
).sql(),
|
||||
"SELECT * FROM foo WHERE x > 0 AND y IS FALSE",
|
||||
)
|
||||
|
||||
def test_function_building(self):
|
||||
self.assertEqual(exp.func("max", 1).sql(), "MAX(1)")
|
||||
|
@ -645,6 +657,7 @@ class TestExpressions(unittest.TestCase):
|
|||
self.assertIsInstance(parse_one("TO_HEX(foo)", read="bigquery"), exp.Hex)
|
||||
self.assertIsInstance(parse_one("TO_HEX(MD5(foo))", read="bigquery"), exp.MD5)
|
||||
self.assertIsInstance(parse_one("TRANSFORM(a, b)", read="spark"), exp.Transform)
|
||||
self.assertIsInstance(parse_one("ADD_MONTHS(a, b)"), exp.AddMonths)
|
||||
|
||||
def test_column(self):
|
||||
column = parse_one("a.b.c.d")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue