Adding upstream version 21.0.1.
Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
parent
07f4660f31
commit
91f2cef5f0
115 changed files with 66603 additions and 60920 deletions
|
@ -10,7 +10,7 @@ from tests.helpers import assert_logger_contains
|
|||
|
||||
class TestParser(unittest.TestCase):
|
||||
def test_parse_empty(self):
|
||||
with self.assertRaises(ParseError) as ctx:
|
||||
with self.assertRaises(ParseError):
|
||||
parse_one("")
|
||||
|
||||
def test_parse_into(self):
|
||||
|
@ -805,3 +805,37 @@ class TestParser(unittest.TestCase):
|
|||
error_level=ErrorLevel.IGNORE,
|
||||
)
|
||||
self.assertEqual(ast[0].sql(), "CONCAT_WS()")
|
||||
|
||||
def test_parse_drop_schema(self):
|
||||
for dialect in [None, "bigquery", "snowflake"]:
|
||||
with self.subTest(dialect):
|
||||
ast = parse_one("DROP SCHEMA catalog.schema", dialect=dialect)
|
||||
self.assertEqual(
|
||||
ast,
|
||||
exp.Drop(
|
||||
this=exp.Table(
|
||||
this=None,
|
||||
db=exp.Identifier(this="schema", quoted=False),
|
||||
catalog=exp.Identifier(this="catalog", quoted=False),
|
||||
),
|
||||
kind="SCHEMA",
|
||||
),
|
||||
)
|
||||
self.assertEqual(ast.sql(dialect=dialect), "DROP SCHEMA catalog.schema")
|
||||
|
||||
def test_parse_create_schema(self):
|
||||
for dialect in [None, "bigquery", "snowflake"]:
|
||||
with self.subTest(dialect):
|
||||
ast = parse_one("CREATE SCHEMA catalog.schema", dialect=dialect)
|
||||
self.assertEqual(
|
||||
ast,
|
||||
exp.Create(
|
||||
this=exp.Table(
|
||||
this=None,
|
||||
db=exp.Identifier(this="schema", quoted=False),
|
||||
catalog=exp.Identifier(this="catalog", quoted=False),
|
||||
),
|
||||
kind="SCHEMA",
|
||||
),
|
||||
)
|
||||
self.assertEqual(ast.sql(dialect=dialect), "CREATE SCHEMA catalog.schema")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue