wangyum commented on code in PR #37574:
URL: https://github.com/apache/spark/pull/37574#discussion_r957914905


##########
sql/core/src/test/scala/org/apache/spark/sql/FileBasedDataSourceSuite.scala:
##########
@@ -257,58 +257,64 @@ class FileBasedDataSourceSuite extends QueryTest
   // Text file format only supports string type
   test("SPARK-24691 error handling for unsupported types - text") {
     withTempDir { dir =>
+      def validateErrorMessage(msg: String, column: String, dt: String, 
format: String): Unit = {
+        val excepted = s"column `$column` has a data type of $dt, " +
+          s"which is not supported by $format."
+        assert(msg.toLowerCase(Locale.ROOT).contains(excepted))
+      }
+
       // write path
       val textDir = new File(dir, "text").getCanonicalPath
       var msg = intercept[AnalysisException] {
         Seq(1).toDF.write.text(textDir)
       }.getMessage
-      assert(msg.contains("Text data source does not support int data type"))
+      validateErrorMessage(msg, "value", "int", "text")

Review Comment:
   `validateErrorMessage(msg, "value", "int", "text")` -> 
`validateErrorMessage(msg, "value", "int", "Text")`?



-- 
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]

Reply via email to