diff --git a/python/pyspark/sql/tests/test_udf.py b/python/pyspark/sql/tests/test_udf.py index e40c3ba0d6479..40deac992c4bd 100644 --- a/python/pyspark/sql/tests/test_udf.py +++ b/python/pyspark/sql/tests/test_udf.py @@ -258,7 +258,7 @@ def test_udf_not_supported_in_join_condition(self): def runWithJoinType(join_type, type_string): with self.assertRaisesRegex( AnalysisException, - """Using PythonUDF in join condition of join type "%s" is not supported""" + """Using PythonUDF in join condition of join type %s is not supported""" % type_string, ): left.join(right, [f("a", "b"), left.a1 == right.b1], join_type).collect() diff --git a/sql/catalyst/src/main/scala/org/apache/spark/sql/errors/QueryErrorsBase.scala b/sql/catalyst/src/main/scala/org/apache/spark/sql/errors/QueryErrorsBase.scala index 1f8fa1e1b4c86..caf24156c8f3f 100644 --- a/sql/catalyst/src/main/scala/org/apache/spark/sql/errors/QueryErrorsBase.scala +++ b/sql/catalyst/src/main/scala/org/apache/spark/sql/errors/QueryErrorsBase.scala @@ -52,9 +52,8 @@ trait QueryErrorsBase { "\"" + elem + "\"" } - // Quote sql statements in error messages. def toSQLStmt(text: String): String = { - quoteByDefault(text.toUpperCase(Locale.ROOT)) + text.toUpperCase(Locale.ROOT) } def toSQLId(parts: Seq[String]): String = { diff --git a/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/optimizer/ExtractPythonUDFFromJoinConditionSuite.scala b/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/optimizer/ExtractPythonUDFFromJoinConditionSuite.scala index 1e58f5c94b073..7f4bb12ebb19b 100644 --- a/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/optimizer/ExtractPythonUDFFromJoinConditionSuite.scala +++ b/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/optimizer/ExtractPythonUDFFromJoinConditionSuite.scala @@ -189,7 +189,7 @@ class ExtractPythonUDFFromJoinConditionSuite extends PlanTest { } assert(e.message == "The feature is not supported: " + - s"""Using PythonUDF in join condition of join type "${joinType.sql}" is not supported.""") + s"""Using PythonUDF in join condition of join type ${joinType.sql} is not supported.""") val query2 = testRelationLeft.join( testRelationRight, diff --git a/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/parser/DDLParserSuite.scala b/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/parser/DDLParserSuite.scala index 08c36401e0bcf..5be46243c472c 100644 --- a/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/parser/DDLParserSuite.scala +++ b/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/parser/DDLParserSuite.scala @@ -2069,11 +2069,11 @@ class DDLParserSuite extends AnalysisTest { comparePlans( parsePlan("SHOW FUNCTIONS IN db LIKE 'funct*'"), ShowFunctions(UnresolvedNamespace(Seq("db")), true, true, Some("funct*"))) - intercept("SHOW other FUNCTIONS", "\"SHOW\" other \"FUNCTIONS\" not supported") + intercept("SHOW other FUNCTIONS", "SHOW other FUNCTIONS not supported") intercept("SHOW FUNCTIONS IN db f1", - "Invalid pattern in \"SHOW FUNCTIONS\": `f1`") + "Invalid pattern in SHOW FUNCTIONS: `f1`") intercept("SHOW FUNCTIONS IN db LIKE f1", - "Invalid pattern in \"SHOW FUNCTIONS\": `f1`") + "Invalid pattern in SHOW FUNCTIONS: `f1`") // The legacy syntax. comparePlans( diff --git a/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/parser/PlanParserSuite.scala b/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/parser/PlanParserSuite.scala index d791496b22756..d1787cb766635 100644 --- a/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/parser/PlanParserSuite.scala +++ b/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/parser/PlanParserSuite.scala @@ -1245,7 +1245,7 @@ class PlanParserSuite extends AnalysisTest { | "escapeChar" = "\\") |FROM testData """.stripMargin, - "\"TRANSFORM\" with serde is only supported in hive mode") + "TRANSFORM with serde is only supported in hive mode") } diff --git a/sql/core/src/test/resources/sql-tests/results/join-lateral.sql.out b/sql/core/src/test/resources/sql-tests/results/join-lateral.sql.out index 6e47579a9b011..cc1619813dd55 100644 --- a/sql/core/src/test/resources/sql-tests/results/join-lateral.sql.out +++ b/sql/core/src/test/resources/sql-tests/results/join-lateral.sql.out @@ -153,7 +153,7 @@ struct<> -- !query output org.apache.spark.sql.catalyst.parser.ParseException -The feature is not supported: "LATERAL" join with "NATURAL" join.(line 1, pos 14) +The feature is not supported: LATERAL join with NATURAL join.(line 1, pos 14) == SQL == SELECT * FROM t1 NATURAL JOIN LATERAL (SELECT c1 + c2 AS c2) @@ -167,7 +167,7 @@ struct<> -- !query output org.apache.spark.sql.catalyst.parser.ParseException -The feature is not supported: "LATERAL" join with "USING" join.(line 1, pos 14) +The feature is not supported: LATERAL join with USING join.(line 1, pos 14) == SQL == SELECT * FROM t1 JOIN LATERAL (SELECT c1 + c2 AS c2) USING (c2) diff --git a/sql/core/src/test/resources/sql-tests/results/transform.sql.out b/sql/core/src/test/resources/sql-tests/results/transform.sql.out index 69fe58e1343d1..be57390761ba3 100644 --- a/sql/core/src/test/resources/sql-tests/results/transform.sql.out +++ b/sql/core/src/test/resources/sql-tests/results/transform.sql.out @@ -719,7 +719,7 @@ struct<> -- !query output org.apache.spark.sql.catalyst.parser.ParseException -The feature is not supported: "TRANSFORM" does not support "DISTINCT"/"ALL" in inputs(line 1, pos 17) +The feature is not supported: TRANSFORM does not support DISTINCT/ALL in inputs(line 1, pos 17) == SQL == SELECT TRANSFORM(DISTINCT b, a, c) @@ -739,7 +739,7 @@ struct<> -- !query output org.apache.spark.sql.catalyst.parser.ParseException -The feature is not supported: "TRANSFORM" does not support "DISTINCT"/"ALL" in inputs(line 1, pos 17) +The feature is not supported: TRANSFORM does not support DISTINCT/ALL in inputs(line 1, pos 17) == SQL == SELECT TRANSFORM(ALL b, a, c) diff --git a/sql/core/src/test/scala/org/apache/spark/sql/errors/QueryCompilationErrorsDSv2Suite.scala b/sql/core/src/test/scala/org/apache/spark/sql/errors/QueryCompilationErrorsDSv2Suite.scala index 95850ee7f6e96..a8fbfc49a5086 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/errors/QueryCompilationErrorsDSv2Suite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/errors/QueryCompilationErrorsDSv2Suite.scala @@ -43,7 +43,7 @@ class QueryCompilationErrorsDSv2Suite checkAnswer(spark.table(tbl), spark.emptyDataFrame) assert(e.getMessage === "The feature is not supported: " + - s""""IF NOT EXISTS" for the table `testcat`.`ns1`.`ns2`.`tbl` by "INSERT INTO".""") + s"""IF NOT EXISTS for the table `testcat`.`ns1`.`ns2`.`tbl` by INSERT INTO.""") assert(e.getErrorClass === "UNSUPPORTED_FEATURE") assert(e.getSqlState === "0A000") } diff --git a/sql/core/src/test/scala/org/apache/spark/sql/errors/QueryCompilationErrorsSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/errors/QueryCompilationErrorsSuite.scala index 3c9b55a21ea9d..42743d2f3cb18 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/errors/QueryCompilationErrorsSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/errors/QueryCompilationErrorsSuite.scala @@ -149,7 +149,7 @@ class QueryCompilationErrorsSuite extends QueryTest with SharedSparkSession { assert(e.getSqlState === "0A000") assert(e.message === "The feature is not supported: " + - "Using PythonUDF in join condition of join type \"LEFT OUTER\" is not supported.") + "Using PythonUDF in join condition of join type LEFT OUTER is not supported.") } test("UNSUPPORTED_FEATURE: Using pandas UDF aggregate expression with pivot") { diff --git a/sql/core/src/test/scala/org/apache/spark/sql/errors/QueryExecutionErrorsSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/errors/QueryExecutionErrorsSuite.scala index d8fc1a52c0bfa..af6402e4fe2ea 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/errors/QueryExecutionErrorsSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/errors/QueryExecutionErrorsSuite.scala @@ -156,7 +156,7 @@ class QueryExecutionErrorsSuite extends QueryTest } assert(e1.getErrorClass === "UNSUPPORTED_FEATURE") assert(e1.getSqlState === "0A000") - assert(e1.getMessage === """The feature is not supported: Repeated "PIVOT"s.""") + assert(e1.getMessage === """The feature is not supported: Repeated PIVOTs.""") val e2 = intercept[SparkUnsupportedOperationException] { trainingSales @@ -167,7 +167,7 @@ class QueryExecutionErrorsSuite extends QueryTest } assert(e2.getErrorClass === "UNSUPPORTED_FEATURE") assert(e2.getSqlState === "0A000") - assert(e2.getMessage === """The feature is not supported: "PIVOT" not after a "GROUP BY".""") + assert(e2.getMessage === """The feature is not supported: PIVOT not after a GROUP BY.""") } test("INCONSISTENT_BEHAVIOR_CROSS_VERSION: " + diff --git a/sql/core/src/test/scala/org/apache/spark/sql/errors/QueryParsingErrorsSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/errors/QueryParsingErrorsSuite.scala index 057bccce3ef6b..508f551bcec95 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/errors/QueryParsingErrorsSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/errors/QueryParsingErrorsSuite.scala @@ -44,7 +44,7 @@ class QueryParsingErrorsSuite extends QueryTest with SharedSparkSession { sqlState = "0A000", message = """ - |The feature is not supported: "LATERAL" join with "NATURAL" join.(line 1, pos 14) + |The feature is not supported: LATERAL join with NATURAL join.(line 1, pos 14) | |== SQL == |SELECT * FROM t1 NATURAL JOIN LATERAL (SELECT c1 + c2 AS c2) @@ -59,7 +59,7 @@ class QueryParsingErrorsSuite extends QueryTest with SharedSparkSession { sqlState = "0A000", message = """ - |The feature is not supported: "LATERAL" join with "USING" join.(line 1, pos 14) + |The feature is not supported: LATERAL join with USING join.(line 1, pos 14) | |== SQL == |SELECT * FROM t1 JOIN LATERAL (SELECT c1 + c2 AS c2) USING (c2) @@ -75,7 +75,7 @@ class QueryParsingErrorsSuite extends QueryTest with SharedSparkSession { sqlState = "0A000", message = s""" - |The feature is not supported: "LATERAL" join type "$joinType".(line 1, pos 14) + |The feature is not supported: LATERAL join type $joinType.(line 1, pos 14) | |== SQL == |SELECT * FROM t1 $joinType JOIN LATERAL (SELECT c1 + c2 AS c3) ON c2 = c3 @@ -99,7 +99,7 @@ class QueryParsingErrorsSuite extends QueryTest with SharedSparkSession { sqlState = "42000", message = s""" - |Invalid SQL syntax: "LATERAL" can only be used with subquery.(line 1, pos $pos) + |Invalid SQL syntax: LATERAL can only be used with subquery.(line 1, pos $pos) | |== SQL == |$sqlText @@ -115,7 +115,7 @@ class QueryParsingErrorsSuite extends QueryTest with SharedSparkSession { sqlState = "0A000", message = """ - |The feature is not supported: "NATURAL CROSS JOIN".(line 1, pos 14) + |The feature is not supported: NATURAL CROSS JOIN.(line 1, pos 14) | |== SQL == |SELECT * FROM a NATURAL CROSS JOIN b @@ -175,7 +175,7 @@ class QueryParsingErrorsSuite extends QueryTest with SharedSparkSession { sqlState = "0A000", message = """ - |The feature is not supported: "TRANSFORM" does not support "DISTINCT"/"ALL" in inputs(line 1, pos 17) + |The feature is not supported: TRANSFORM does not support DISTINCT/ALL in inputs(line 1, pos 17) | |== SQL == |SELECT TRANSFORM(DISTINCT a) USING 'a' FROM t @@ -191,7 +191,7 @@ class QueryParsingErrorsSuite extends QueryTest with SharedSparkSession { sqlState = "0A000", message = """ - |The feature is not supported: "TRANSFORM" with serde is only supported in hive mode(line 1, pos 0) + |The feature is not supported: TRANSFORM with serde is only supported in hive mode(line 1, pos 0) | |== SQL == |SELECT TRANSFORM(a) ROW FORMAT SERDE 'org.apache.hadoop.hive.serde2.OpenCSVSerde' USING 'a' FROM t diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/SparkScriptTransformationSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/SparkScriptTransformationSuite.scala index 1f431e173b3c7..5638743b7633d 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/execution/SparkScriptTransformationSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/SparkScriptTransformationSuite.scala @@ -56,7 +56,7 @@ class SparkScriptTransformationSuite extends BaseScriptTransformationSuite with |FROM v """.stripMargin) }.getMessage - assert(e.contains("\"TRANSFORM\" with serde is only supported in hive mode")) + assert(e.contains("TRANSFORM with serde is only supported in hive mode")) } } }