MaxGekk commented on a change in pull request #31979:
URL: https://github.com/apache/spark/pull/31979#discussion_r602907906
##########
File path:
sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveScriptTransformationSuite.scala
##########
@@ -528,4 +530,65 @@ class HiveScriptTransformationSuite extends
BaseScriptTransformationSuite with T
checkAnswer(query2, identity, Row("\\N,\\N,\\N") :: Nil)
}
+
+ test("SPARK-34879: HiveInspector supports DayTimeIntervalType and
YearMonthIntervalType") {
+ assume(TestUtils.testCommandAvailable("/bin/bash"))
+ withTempView("v") {
+ val df = Seq(
+ (Duration.ofDays(1),
+ Duration.ofSeconds(100).plusNanos(123456),
+ Duration.ofSeconds(Long.MaxValue /
DateTimeConstants.MICROS_PER_SECOND),
+ Period.ofMonths(10)),
+ (Duration.ofDays(1),
+ Duration.ofSeconds(100).plusNanos(1123456789),
+ Duration.ofSeconds(Long.MaxValue /
DateTimeConstants.MICROS_PER_SECOND),
+ Period.ofMonths(10))
+ ).toDF("a", "b", "c", "d")
+ .select('a, 'b, 'c.cast(DayTimeIntervalType).as("c_1"), 'd)
Review comment:
`'a` is deprecated in the future scala versions. I wouldn't use it.
--
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.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]