summaryrefslogtreecommitdiffstats
path: root/tests/dialects/test_tsql.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2022-12-22 07:22:56 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2022-12-22 07:22:56 +0000
commit85bf7f61d00f60343363b7c6dc98f2d0b5a8e621 (patch)
tree76c8712faaa2753e3997de25eb3a69c3ec450979 /tests/dialects/test_tsql.py
parentAdding upstream version 10.2.6. (diff)
downloadsqlglot-85bf7f61d00f60343363b7c6dc98f2d0b5a8e621.tar.xz
sqlglot-85bf7f61d00f60343363b7c6dc98f2d0b5a8e621.zip
Adding upstream version 10.2.9.upstream/10.2.9
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/dialects/test_tsql.py')
-rw-r--r--tests/dialects/test_tsql.py24
1 files changed, 22 insertions, 2 deletions
diff --git a/tests/dialects/test_tsql.py b/tests/dialects/test_tsql.py
index afdd48a..e4c6e60 100644
--- a/tests/dialects/test_tsql.py
+++ b/tests/dialects/test_tsql.py
@@ -371,13 +371,19 @@ class TestTSQL(Validator):
self.validate_all(
"SELECT t.x, y.z FROM x CROSS APPLY tvfTest(t.x)y(z)",
write={
- "spark": "SELECT t.x, y.z FROM x JOIN LATERAL TVFTEST(t.x) y AS z",
+ "spark": "SELECT t.x, y.z FROM x JOIN LATERAL TVFTEST(t.x) AS y(z)",
},
)
self.validate_all(
"SELECT t.x, y.z FROM x OUTER APPLY tvfTest(t.x)y(z)",
write={
- "spark": "SELECT t.x, y.z FROM x LEFT JOIN LATERAL TVFTEST(t.x) y AS z",
+ "spark": "SELECT t.x, y.z FROM x LEFT JOIN LATERAL TVFTEST(t.x) AS y(z)",
+ },
+ )
+ self.validate_all(
+ "SELECT t.x, y.z FROM x OUTER APPLY a.b.tvfTest(t.x)y(z)",
+ write={
+ "spark": "SELECT t.x, y.z FROM x LEFT JOIN LATERAL a.b.TVFTEST(t.x) AS y(z)",
},
)
@@ -421,3 +427,17 @@ class TestTSQL(Validator):
self.validate_all(
"SELECT FORMAT(num_col, 'c')", write={"spark": "SELECT FORMAT_NUMBER(num_col, 'c')"}
)
+
+ def test_string(self):
+ self.validate_all(
+ "SELECT N'test'",
+ write={"spark": "SELECT 'test'"},
+ )
+ self.validate_all(
+ "SELECT n'test'",
+ write={"spark": "SELECT 'test'"},
+ )
+ self.validate_all(
+ "SELECT '''test'''",
+ write={"spark": r"SELECT '\'test\''"},
+ )