Skip to content

Commit 4068289

Browse files
committed
cal instead of c
1 parent 79beb00 commit 4068289

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -429,8 +429,8 @@ case class DayOfMonth(child: Expression) extends UnaryExpression with ImplicitCa
429429
case class DayOfWeek(child: Expression) extends DayWeek {
430430

431431
override protected def nullSafeEval(date: Any): Any = {
432-
c.setTimeInMillis(date.asInstanceOf[Int] * 1000L * 3600L * 24L)
433-
c.get(Calendar.DAY_OF_WEEK)
432+
cal.setTimeInMillis(date.asInstanceOf[Int] * 1000L * 3600L * 24L)
433+
cal.get(Calendar.DAY_OF_WEEK)
434434
}
435435

436436
override protected def doGenCode(ctx: CodegenContext, ev: ExprCode): ExprCode = {
@@ -461,8 +461,8 @@ case class DayOfWeek(child: Expression) extends DayWeek {
461461
case class WeekDay(child: Expression) extends DayWeek {
462462

463463
override protected def nullSafeEval(date: Any): Any = {
464-
c.setTimeInMillis(date.asInstanceOf[Int] * 1000L * 3600L * 24L)
465-
(c.get(Calendar.DAY_OF_WEEK) + 5 ) % 7
464+
cal.setTimeInMillis(date.asInstanceOf[Int] * 1000L * 3600L * 24L)
465+
(cal.get(Calendar.DAY_OF_WEEK) + 5 ) % 7
466466
}
467467

468468
override protected def doGenCode(ctx: CodegenContext, ev: ExprCode): ExprCode = {
@@ -486,7 +486,7 @@ abstract class DayWeek extends UnaryExpression with ImplicitCastInputTypes {
486486

487487
override def dataType: DataType = IntegerType
488488

489-
@transient protected lazy val c: Calendar = {
489+
@transient protected lazy val cal: Calendar = {
490490
Calendar.getInstance(DateTimeUtils.getTimeZone("UTC"))
491491
}
492492
}

0 commit comments

Comments
 (0)