Skip to content

Commit 58a17e5

Browse files
committed
[SPARK-51419][SQL] Get hour of TIME datatype
1 parent 1c41938 commit 58a17e5

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/timeExpressions.scala

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,6 @@ object MinuteExpressionBuilder extends ExpressionBuilder {
234234
}
235235
}
236236

237-
// scalastyle:off line.size.limit
238237
@ExpressionDescription(
239238
usage = """
240239
_FUNC_(time_expr) - Returns the hour component of the given time.
@@ -271,7 +270,7 @@ case class HoursOfTime(child: Expression)
271270
}
272271
}
273272

274-
// scalastyle:off line.size.limit
273+
275274
@ExpressionDescription(
276275
usage = """
277276
_FUNC_(expr) - Returns the hour component of the given expression.

sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/TimeExpressionsSuite.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ class TimeExpressionsSuite extends SparkFunSuite with ExpressionEvalHelper {
6767
"docroot" -> SPARK_DOC_ROOT)
6868
)
6969

70-
// test TIME-typed child should build MinutesOfTime
70+
// test TIME-typed child should build HoursOfTime
7171
val timeExpr = Literal(localTime(12, 58, 59), TimeType())
7272
val builtExprForTime = HourExpressionBuilder.build("hour", Seq(timeExpr))
7373
assert(builtExprForTime.isInstanceOf[HoursOfTime])

0 commit comments

Comments
 (0)