AngersZhuuuu commented on a change in pull request #33217:
URL: https://github.com/apache/spark/pull/33217#discussion_r664202409
##########
File path:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/util/IntervalUtils.scala
##########
@@ -119,6 +119,39 @@ object IntervalUtils {
}
}
+ private def throwIllegalIntervalFormatException(
+ input: UTF8String,
+ startFiled: Byte,
+ endField: Byte,
+ intervalStr: String,
+ typeName: String,
+ fallBackNotice: Option[String] = None) = {
+ throw new IllegalArgumentException(
+ s"Interval string does not match $intervalStr format of " +
+ s"${supportedFormat((startFiled, endField)).map(format =>
s"`$format`").mkString(", ")} " +
+ s"when cast to $typeName: ${input.toString}" +
+ s"${fallBackNotice.map(s => s", $s").getOrElse("")}")
+ }
+
+ private def checkStringIntervalType(
+ input: UTF8String,
+ targetStartField: Byte,
+ targetEndField: Byte,
+ inputIntervalType: DataType,
+ fallBackNotice: Option[String] = None): Unit = {
Review comment:
FYI @MaxGekk rename the parameter make it more clear
--
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]