Skip to content

Commit 2fe20c4

Browse files
committed
util.Date
1 parent ea2ec16 commit 2fe20c4

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ case class UnixTimestamp(timeExp: Expression, format: Expression)
296296

297297
override def dataType: DataType = LongType
298298

299-
lazy val constFormat: UTF8String = right.eval().asInstanceOf[UTF8String]
299+
private lazy val constFormat: UTF8String = right.eval().asInstanceOf[UTF8String]
300300

301301
override def eval(input: InternalRow): Any = {
302302
val t = left.eval(input)
@@ -413,7 +413,7 @@ case class FromUnixTime(sec: Expression, format: Expression)
413413

414414
override def inputTypes: Seq[AbstractDataType] = Seq(LongType, StringType)
415415

416-
lazy val constFormat: UTF8String = right.eval().asInstanceOf[UTF8String]
416+
private lazy val constFormat: UTF8String = right.eval().asInstanceOf[UTF8String]
417417

418418
override def eval(input: InternalRow): Any = {
419419
val time = left.eval(input)
@@ -457,7 +457,7 @@ case class FromUnixTime(sec: Expression, format: Expression)
457457
if (!${ev.isNull}) {
458458
try {
459459
${ev.primitive} = UTF8String.fromString(new $sdf("${constFormat.toString}").format(
460-
new java.sql.Timestamp(${t.primitive} * 1000L)));
460+
new java.util.Date(${t.primitive} * 1000L)));
461461
} catch (java.lang.Throwable e) {
462462
${ev.isNull} = true;
463463
}

0 commit comments

Comments
 (0)