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


##########
sql/hive/src/test/scala/org/apache/spark/sql/hive/orc/HiveOrcSourceSuite.scala:
##########
@@ -112,37 +113,43 @@ class HiveOrcSourceSuite extends OrcSuite with 
TestHiveSingleton {
     withTempDir { dir =>
       val orcDir = new File(dir, "orc").getCanonicalPath
 
+      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
       var msg = intercept[AnalysisException] {
         sql("select interval 1 days").write.mode("overwrite").orc(orcDir)
       }.getMessage
-      assert(msg.contains("ORC data source does not support interval day data 
type"))
+      validateErrorMessage(msg, "interval '1' day", "interval day", "orc")

Review Comment:
   `validateErrorMessage(msg, "interval '1' day", "interval day", "orc")` -> 
`validateErrorMessage(msg, "INTERVAL '1' DAY", "interval day", "ORC")`?



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