Github user adrian-wang commented on a diff in the pull request: https://github.com/apache/spark/pull/2344#discussion_r17710004 --- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/Cast.scala --- @@ -95,6 +100,8 @@ case class Cast(child: Expression, dataType: DataType) extends UnaryExpression { buildCast[Short](_, s => new Timestamp(s * 1000)) case ByteType => buildCast[Byte](_, b => new Timestamp(b * 1000)) + case DateType => + buildCast[Date](_, d => Timestamp.valueOf(dateToString(d) + " 00:00:00")) --- End diff -- If the date `d` is polluted, for example `d.setTime(d.getTime + 1)`, this would be in a turmoil. I'm not sure if there's any way to get into that. Maybe before that really occurs, we can just use `new Timestamp(d.getTime)`
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org