cloud-fan commented on a change in pull request #32940:
URL: https://github.com/apache/spark/pull/32940#discussion_r657145267



##########
File path: 
sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/CastSuiteBase.scala
##########
@@ -1038,6 +1034,13 @@ abstract class CastSuiteBase extends SparkFunSuite with 
ExpressionEvalHelper {
           }.getMessage
           assert(e.contains("Error parsing interval year-month string: integer 
overflow"))
         }
+
+      Seq("1-1", " 1-8").foreach { interval =>
+          val e = intercept[IllegalArgumentException] {
+            cast(Literal.create(interval), YearMonthIntervalType()).eval()
+          }.getMessage
+          assert(e.contains("Interval string does not match year-month 
format"))

Review comment:
       and we should NOT fail if it's INTERVAL YEAR TO MONTH




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

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