Skip to content

Commit 5429212

Browse files
committed
change to long
1 parent f8f219f commit 5429212

File tree

1 file changed

+1
-1
lines changed
  • sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ case class Cast(child: Expression, dataType: DataType) extends UnaryExpression w
161161
case TimestampType =>
162162
// throw valid precision more than seconds, according to Hive.
163163
// Timestamp.nanos is in 0 to 999,999,999, no more than a second.
164-
buildCast[Timestamp](_, t => new Date(Math.floor(t.getTime / 1000.0).toInt * 1000))
164+
buildCast[Timestamp](_, t => new Date(Math.floor(t.getTime / 1000.0).toLong * 1000))
165165
// Hive throws this exception as a Semantic Exception
166166
// It is never possible to compare result when hive return with exception, so we can return null
167167
// NULL is more reasonable here, since the query itself obeys the grammar.

0 commit comments

Comments
 (0)