New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SPARK-36208][SQL] SparkScriptTransformation should support ANSI interval types #33419
Conversation
Kubernetes integration test unable to build dist. exiting with code: 1 |
Test build #141255 has finished for PR 33419 at commit
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please, use utils functions.
data => Duration.ofNanos(IntervalUtils.castStringToDTInterval( | ||
UTF8String.fromString(data), start, end) * DateTimeConstants.NANOS_PER_MICROS), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
data => Duration.ofNanos(IntervalUtils.castStringToDTInterval( | |
UTF8String.fromString(data), start, end) * DateTimeConstants.NANOS_PER_MICROS), | |
data => IntervalUtils.microsToDuration( | |
IntervalUtils.castStringToDTInterval(UTF8String.fromString(data), start, end)), |
@@ -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( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
data => Period.ofMonths( | |
data => IntervalUtils.monthsToPeriod( |
@MaxGekk Thanks, got it. |
Kubernetes integration test starting |
Kubernetes integration test status success |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Waiting for jenkins.
Test build #141378 has finished for PR 33419 at commit
|
+1, LGTM. Merging to master. |
…rval types This PR changes `BaseScriptTransformationExec` for `SparkScriptTransformationExec` to support ANSI interval types. `SparkScriptTransformationExec` support `CalendarIntervalType` so it's better to support ANSI interval types as well. No. New test. Closes apache#33419 from sarutak/script-transformation-interval. Authored-by: Kousuke Saruta <sarutak@oss.nttdata.com> Signed-off-by: Max Gekk <max.gekk@gmail.com> (cherry picked from commit f56c7b7) Signed-off-by: Max Gekk <max.gekk@gmail.com>
@sarutak Sorry, I haven't merged to branch-3.2. Here is the PR for it: #33463 @HyukjinKwon @gengliangwang Could you approve it, please. |
What changes were proposed in this pull request?
This PR changes
BaseScriptTransformationExec
forSparkScriptTransformationExec
to support ANSI interval types.Why are the changes needed?
SparkScriptTransformationExec
supportCalendarIntervalType
so it's better to support ANSI interval types as well.Does this PR introduce any user-facing change?
No.
How was this patch tested?
New test.