Adding upstream version 11.1.3.
Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
parent
e09ae33d10
commit
85cdf062c9
95 changed files with 32569 additions and 30081 deletions
|
@ -1,4 +1,4 @@
|
|||
from sqlglot import UnsupportedError
|
||||
from sqlglot import UnsupportedError, exp, parse_one
|
||||
from tests.dialects.test_dialect import Validator
|
||||
|
||||
|
||||
|
@ -6,6 +6,7 @@ class TestSnowflake(Validator):
|
|||
dialect = "snowflake"
|
||||
|
||||
def test_snowflake(self):
|
||||
self.validate_identity("$x")
|
||||
self.validate_identity("SELECT REGEXP_LIKE(a, b, c)")
|
||||
self.validate_identity("PUT file:///dir/tmp.csv @%table")
|
||||
self.validate_identity("CREATE TABLE foo (bar FLOAT AUTOINCREMENT START 0 INCREMENT 1)")
|
||||
|
@ -202,10 +203,10 @@ class TestSnowflake(Validator):
|
|||
self.validate_all(
|
||||
r"SELECT $$a ' \ \t \x21 z $ $$",
|
||||
write={
|
||||
"snowflake": r"SELECT 'a \' \\ \t \\x21 z $ '",
|
||||
"snowflake": r"SELECT 'a \' \ \t \x21 z $ '",
|
||||
},
|
||||
)
|
||||
self.validate_identity(r"REGEXP_REPLACE('target', 'pattern', '\n')")
|
||||
self.validate_identity("REGEXP_REPLACE('target', 'pattern', '\n')")
|
||||
self.validate_all(
|
||||
"SELECT RLIKE(a, b)",
|
||||
write={
|
||||
|
@ -612,6 +613,13 @@ FROM persons AS p, LATERAL FLATTEN(input => p.c, path => 'contact') AS f, LATERA
|
|||
},
|
||||
)
|
||||
|
||||
def test_parse_like_any(self):
|
||||
like = parse_one("a LIKE ANY fun('foo')", read="snowflake")
|
||||
ilike = parse_one("a ILIKE ANY fun('foo')", read="snowflake")
|
||||
|
||||
self.assertIsInstance(like, exp.LikeAny)
|
||||
self.assertIsInstance(ilike, exp.ILikeAny)
|
||||
|
||||
def test_match_recognize(self):
|
||||
for row in (
|
||||
"ONE ROW PER MATCH",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue