Adding upstream version 10.0.8.
Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
parent
1e860cc299
commit
87cdb8246e
67 changed files with 2461 additions and 840 deletions
|
@ -29,6 +29,7 @@ class TestOptimizer(unittest.TestCase):
|
|||
CREATE TABLE x (a INT, b INT);
|
||||
CREATE TABLE y (b INT, c INT);
|
||||
CREATE TABLE z (b INT, c INT);
|
||||
CREATE TABLE w (d TEXT, e TEXT);
|
||||
|
||||
INSERT INTO x VALUES (1, 1);
|
||||
INSERT INTO x VALUES (2, 2);
|
||||
|
@ -47,6 +48,8 @@ class TestOptimizer(unittest.TestCase):
|
|||
INSERT INTO y VALUES (4, 4);
|
||||
INSERT INTO y VALUES (5, 5);
|
||||
INSERT INTO y VALUES (null, null);
|
||||
|
||||
INSERT INTO w VALUES ('a', 'b');
|
||||
"""
|
||||
)
|
||||
|
||||
|
@ -64,6 +67,10 @@ class TestOptimizer(unittest.TestCase):
|
|||
"b": "INT",
|
||||
"c": "INT",
|
||||
},
|
||||
"w": {
|
||||
"d": "TEXT",
|
||||
"e": "TEXT",
|
||||
},
|
||||
}
|
||||
|
||||
def check_file(self, file, func, pretty=False, execute=False, **kwargs):
|
||||
|
@ -224,6 +231,18 @@ class TestOptimizer(unittest.TestCase):
|
|||
def test_eliminate_subqueries(self):
|
||||
self.check_file("eliminate_subqueries", optimizer.eliminate_subqueries.eliminate_subqueries)
|
||||
|
||||
def test_canonicalize(self):
|
||||
optimize = partial(
|
||||
optimizer.optimize,
|
||||
rules=[
|
||||
optimizer.qualify_tables.qualify_tables,
|
||||
optimizer.qualify_columns.qualify_columns,
|
||||
annotate_types,
|
||||
optimizer.canonicalize.canonicalize,
|
||||
],
|
||||
)
|
||||
self.check_file("canonicalize", optimize, schema=self.schema)
|
||||
|
||||
def test_tpch(self):
|
||||
self.check_file("tpc-h/tpc-h", optimizer.optimize, schema=TPCH_SCHEMA, pretty=True)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue