gengliangwang commented on a change in pull request #33751:
URL: https://github.com/apache/spark/pull/33751#discussion_r689550016



##########
File path: 
sql/core/src/main/scala/org/apache/spark/sql/execution/BaseScriptTransformationExec.scala
##########
@@ -224,9 +224,8 @@ trait BaseScriptTransformationExec extends UnaryExecNode {
         data => IntervalUtils.stringToInterval(UTF8String.fromString(data)),
         converter)
       case YearMonthIntervalType(start, end) => wrapperConvertException(
-        data => IntervalUtils.monthsToPeriod(
-          IntervalUtils.castStringToYMInterval(UTF8String.fromString(data), 
start, end)),
-        converter)
+        data => 
IntervalUtils.castStringToYMInterval(UTF8String.fromString(data), start, end)
+          .map(IntervalUtils.monthsToPeriod).orNull, converter)

Review comment:
       This is following string to date logic in BaseScriptTransformationExec




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