Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion python/pyspark/sql/tests/test_udf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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") {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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: " +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"))
}
}
}