summaryrefslogtreecommitdiffstats
path: root/tests/dataframe/unit
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2023-02-20 08:50:30 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2023-02-20 08:50:30 +0000
commitcc4c7716b8fe6b13bf735ab1ccbc1a92ded4d6d5 (patch)
tree3723d527945944e4fed74f7fe9da43407349351a /tests/dataframe/unit
parentAdding upstream version 11.1.3. (diff)
downloadsqlglot-cc4c7716b8fe6b13bf735ab1ccbc1a92ded4d6d5.tar.xz
sqlglot-cc4c7716b8fe6b13bf735ab1ccbc1a92ded4d6d5.zip
Adding upstream version 11.2.0.upstream/11.2.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/dataframe/unit')
-rw-r--r--tests/dataframe/unit/test_session.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/dataframe/unit/test_session.py b/tests/dataframe/unit/test_session.py
index 5213667..f5b79fd 100644
--- a/tests/dataframe/unit/test_session.py
+++ b/tests/dataframe/unit/test_session.py
@@ -81,6 +81,15 @@ class TestDataframeSession(DataFrameSQLValidator):
)
@mock.patch("sqlglot.schema", MappingSchema())
+ def test_select_quoted(self):
+ sqlglot.schema.add_table('"TEST"', {"name": "string"})
+
+ self.assertEqual(
+ SparkSession().table('"TEST"').select(F.col("name")).sql(dialect="snowflake")[0],
+ '''SELECT "TEST"."name" AS "name" FROM "TEST" AS "TEST"''',
+ )
+
+ @mock.patch("sqlglot.schema", MappingSchema())
def test_sql_with_aggs(self):
# TODO: Do exact matches once CTE names are deterministic
query = "SELECT cola, colb FROM table"