summaryrefslogtreecommitdiffstats
path: root/tests/dialects/test_snowflake.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2023-02-19 13:44:59 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2023-02-19 13:44:59 +0000
commitef2db38de92f2329c1c366318bddfc7e3dee8415 (patch)
treedee41de1eb0e05f2f6805b77df41a71b3aa66ec2 /tests/dialects/test_snowflake.py
parentAdding upstream version 11.0.1. (diff)
downloadsqlglot-ef2db38de92f2329c1c366318bddfc7e3dee8415.tar.xz
sqlglot-ef2db38de92f2329c1c366318bddfc7e3dee8415.zip
Adding upstream version 11.1.3.upstream/11.1.3
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/dialects/test_snowflake.py')
-rw-r--r--tests/dialects/test_snowflake.py14
1 files changed, 11 insertions, 3 deletions
diff --git a/tests/dialects/test_snowflake.py b/tests/dialects/test_snowflake.py
index 201cc4e..9e22527 100644
--- a/tests/dialects/test_snowflake.py
+++ b/tests/dialects/test_snowflake.py
@@ -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",