MaxGekk commented on a change in pull request #33419:
URL: https://github.com/apache/spark/pull/33419#discussion_r673384690
##########
File path:
sql/core/src/main/scala/org/apache/spark/sql/execution/BaseScriptTransformationExec.scala
##########
@@ -223,6 +224,14 @@ trait BaseScriptTransformationExec extends UnaryExecNode {
case CalendarIntervalType => wrapperConvertException(
data => IntervalUtils.stringToInterval(UTF8String.fromString(data)),
converter)
+ case YearMonthIntervalType(start, end) => wrapperConvertException(
+ data => Period.ofMonths(
Review comment:
```suggestion
data => IntervalUtils.monthsToPeriod(
```
##########
File path:
sql/core/src/main/scala/org/apache/spark/sql/execution/BaseScriptTransformationExec.scala
##########
@@ -223,6 +224,14 @@ trait BaseScriptTransformationExec extends UnaryExecNode {
case CalendarIntervalType => wrapperConvertException(
data => IntervalUtils.stringToInterval(UTF8String.fromString(data)),
converter)
+ case YearMonthIntervalType(start, end) => wrapperConvertException(
+ data => Period.ofMonths(
+ IntervalUtils.castStringToYMInterval(UTF8String.fromString(data),
start, end)),
+ converter)
+ case DayTimeIntervalType(start, end) => wrapperConvertException(
+ data => Duration.ofNanos(IntervalUtils.castStringToDTInterval(
+ UTF8String.fromString(data), start, end) *
DateTimeConstants.NANOS_PER_MICROS),
Review comment:
```suggestion
data => IntervalUtils.microsToDuration(
IntervalUtils.castStringToDTInterval(UTF8String.fromString(data),
start, end)),
```
--
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]