MaxGekk commented on code in PR #47846:
URL: https://github.com/apache/spark/pull/47846#discussion_r1730885889


##########
sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/util/IntervalUtilsSuite.scala:
##########
@@ -379,6 +384,15 @@ class IntervalUtilsSuite extends SparkFunSuite with 
SQLHelper {
     assert(negate(new CalendarInterval(1, 2, 3)) === new CalendarInterval(-1, 
-2, -3))
   }
 
+  test("parsing second_nano string") {
+    val parsingException = intercept[SparkIllegalArgumentException] {
+      toDTInterval("12", "33.33.33", 1)
+    }
+
+    assert(parsingException.getErrorClass === 
"INTERVAL_ERROR.SECOND_NANO_FORMAT")
+    assert(parsingException.getSqlState === "22009")
+  }
+

Review Comment:
   >  thus the parameters are not adequate for checking with the function 
checkError()
   
   Please, explain this.
   
   > If you want, I can convert this one
   
   Please, change this to:
   ```scala
       checkError(
         exception = intercept[SparkIllegalArgumentException] {
           toDTInterval("12", "33.33.33", 1)
         },
         errorClass = "INTERVAL_ERROR.SECOND_NANO_FORMAT",
         sqlState = Some("22009")
       )
   ```
   



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