MaxGekk commented on code in PR #41279:
URL: https://github.com/apache/spark/pull/41279#discussion_r1203854477
##########
sql/core/src/test/scala/org/apache/spark/sql/execution/command/v2/ShowPartitionsSuite.scala:
##########
@@ -33,7 +35,9 @@ class ShowPartitionsSuite extends
command.ShowPartitionsSuiteBase with CommandSu
val errMsg = intercept[AnalysisException] {
sql(s"SHOW PARTITIONS $table")
}.getMessage
- assert(errMsg.contains(s"Table $table does not support partition
management"))
+ val tableName =
+
UnresolvedAttribute.parseAttributeName(table).map(quoteIdentifier).mkString(".")
+ assert(errMsg.contains(s"Table $tableName does not support partition
management"))
Review Comment:
Use `checkError`
##########
sql/core/src/test/scala/org/apache/spark/sql/execution/command/v2/AlterTableAddPartitionSuite.scala:
##########
@@ -38,7 +39,8 @@ class AlterTableAddPartitionSuite
val errMsg = intercept[AnalysisException] {
sql(s"ALTER TABLE $t ADD PARTITION (id=1)")
}.getMessage
- assert(errMsg.contains(s"Table $t does not support partition
management"))
+ val tableName =
UnresolvedAttribute.parseAttributeName(t).map(quoteIdentifier).mkString(".")
+ assert(errMsg.contains(s"Table $tableName does not support partition
management"))
Review Comment:
Use `checkError`. This will allow to modify the error messages in the JSON
files by tech editors w/o modifying the internal Spark tests.
##########
sql/core/src/test/scala/org/apache/spark/sql/execution/command/ShowPartitionsSuiteBase.scala:
##########
@@ -69,9 +71,11 @@ trait ShowPartitionsSuiteBase extends QueryTest with
DDLCommandTestUtils {
val errMsg = intercept[AnalysisException] {
sql(s"SHOW PARTITIONS $t")
}.getMessage
+ lazy val tableName =
+
UnresolvedAttribute.parseAttributeName(t).map(quoteIdentifier).mkString(".")
assert(errMsg.contains("not allowed on a table that is not partitioned")
||
// V2 error message.
- errMsg.contains(s"Table $t is not partitioned"))
+ errMsg.contains(s"Table $tableName is not partitioned"))
Review Comment:
Please, use `checkError()`
##########
sql/core/src/test/scala/org/apache/spark/sql/execution/command/v2/TruncateTableSuite.scala:
##########
@@ -36,7 +36,7 @@ class TruncateTableSuite extends
command.TruncateTableSuiteBase with CommandSuit
sql(s"TRUNCATE TABLE $t PARTITION (c0=1)")
}.getMessage
assert(errMsg.contains(
- "Table non_part_test_catalog.ns.tbl does not support partition
management"))
+ "Table `non_part_test_catalog`.`ns`.`tbl` does not support partition
management"))
Review Comment:
Use `checkError`
##########
sql/core/src/test/scala/org/apache/spark/sql/execution/command/v2/AlterTableDropPartitionSuite.scala:
##########
@@ -36,7 +38,8 @@ class AlterTableDropPartitionSuite
val errMsg = intercept[AnalysisException] {
sql(s"ALTER TABLE $t DROP PARTITION (id=1)")
}.getMessage
- assert(errMsg.contains(s"Table $t does not support partition
management"))
+ val tableName =
UnresolvedAttribute.parseAttributeName(t).map(quoteIdentifier).mkString(".")
+ assert(errMsg.contains(s"Table $tableName does not support partition
management"))
Review Comment:
ditto: Use `checkError`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]