Merging upstream version 18.2.0.
Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
parent
985db29269
commit
53cf4a81a6
124 changed files with 60313 additions and 50346 deletions
|
@ -758,6 +758,24 @@ FROM READ_CSV('tests/fixtures/optimizer/tpc-h/nation.csv.gz', 'delimiter', '|')
|
|||
self.assertEqual(exp.DataType.Type.INT, expression.selects[0].type.this)
|
||||
self.assertEqual(exp.DataType.Type.INT, expression.selects[1].type.this)
|
||||
|
||||
def test_nested_type_annotation(self):
|
||||
schema = {"order": {"customer_id": "bigint", "item_id": "bigint", "item_price": "numeric"}}
|
||||
sql = """
|
||||
SELECT ARRAY_AGG(DISTINCT order.item_id) FILTER (WHERE order.item_price > 10) AS items,
|
||||
FROM order AS order
|
||||
GROUP BY order.customer_id
|
||||
"""
|
||||
expression = annotate_types(parse_one(sql), schema=schema)
|
||||
|
||||
self.assertEqual(exp.DataType.Type.ARRAY, expression.selects[0].type.this)
|
||||
self.assertEqual(expression.selects[0].type.sql(), "ARRAY<BIGINT>")
|
||||
|
||||
expression = annotate_types(
|
||||
parse_one("SELECT ARRAY_CAT(ARRAY[1,2,3], ARRAY[4,5])", read="postgres")
|
||||
)
|
||||
self.assertEqual(exp.DataType.Type.ARRAY, expression.selects[0].type.this)
|
||||
self.assertEqual(expression.selects[0].type.sql(), "ARRAY<INT>")
|
||||
|
||||
def test_recursive_cte(self):
|
||||
query = parse_one(
|
||||
"""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue