diff options
author | Josh Rosen <joshrosen@databricks.com> | 2016-08-23 22:31:58 +0200 |
---|---|---|
committer | Herman van Hovell <hvanhovell@databricks.com> | 2016-08-23 22:31:58 +0200 |
commit | bf8ff833e30b39e5e5e35ba8dcac31b79323838c (patch) | |
tree | 976722854fb5da1fde0d485587ebb7e8cf31fb66 /sql/hive/src/test/resources/sqlgen/case_with_key.sql | |
parent | 6555ef0ccbecd09c3071670e10f0c1e2d7713bfe (diff) | |
download | spark-bf8ff833e30b39e5e5e35ba8dcac31b79323838c.tar.gz spark-bf8ff833e30b39e5e5e35ba8dcac31b79323838c.tar.bz2 spark-bf8ff833e30b39e5e5e35ba8dcac31b79323838c.zip |
[SPARK-17194] Use single quotes when generating SQL for string literals
When Spark emits SQL for a string literal, it should wrap the string in single quotes, not double quotes. Databases which adhere more strictly to the ANSI SQL standards, such as Postgres, allow only single-quotes to be used for denoting string literals (see http://stackoverflow.com/a/1992331/590203).
Author: Josh Rosen <joshrosen@databricks.com>
Closes #14763 from JoshRosen/SPARK-17194.
Diffstat (limited to 'sql/hive/src/test/resources/sqlgen/case_with_key.sql')
-rw-r--r-- | sql/hive/src/test/resources/sqlgen/case_with_key.sql | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sql/hive/src/test/resources/sqlgen/case_with_key.sql b/sql/hive/src/test/resources/sqlgen/case_with_key.sql index dff65f1083..e991ebafdc 100644 --- a/sql/hive/src/test/resources/sqlgen/case_with_key.sql +++ b/sql/hive/src/test/resources/sqlgen/case_with_key.sql @@ -1,4 +1,4 @@ -- This file is automatically generated by LogicalPlanToSQLSuite. SELECT CASE id WHEN 0 THEN 'foo' WHEN 1 THEN 'bar' END FROM parquet_t0 -------------------------------------------------------------------------------- -SELECT `gen_attr_0` AS `CASE WHEN (id = CAST(0 AS BIGINT)) THEN foo WHEN (id = CAST(1 AS BIGINT)) THEN bar END` FROM (SELECT CASE WHEN (`gen_attr_1` = CAST(0 AS BIGINT)) THEN "foo" WHEN (`gen_attr_1` = CAST(1 AS BIGINT)) THEN "bar" END AS `gen_attr_0` FROM (SELECT `id` AS `gen_attr_1` FROM `default`.`parquet_t0`) AS gen_subquery_0) AS gen_subquery_1 +SELECT `gen_attr_0` AS `CASE WHEN (id = CAST(0 AS BIGINT)) THEN foo WHEN (id = CAST(1 AS BIGINT)) THEN bar END` FROM (SELECT CASE WHEN (`gen_attr_1` = CAST(0 AS BIGINT)) THEN 'foo' WHEN (`gen_attr_1` = CAST(1 AS BIGINT)) THEN 'bar' END AS `gen_attr_0` FROM (SELECT `id` AS `gen_attr_1` FROM `default`.`parquet_t0`) AS gen_subquery_0) AS gen_subquery_1 |