Skip to content

Commit 6da7905

Browse files
committed
Bug fix: require time zone in the string to date conversion
1 parent 9a2349b commit 6da7905

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
@@ -106,7 +106,7 @@ object Cast {
106106
* * Cast.castToTimestamp
107107
*/
108108
def needsTimeZone(from: DataType, to: DataType): Boolean = (from, to) match {
109-
case (StringType, TimestampType) => true
109+
case (StringType, TimestampType | DateType) => true
110110
case (DateType, TimestampType) => true
111111
case (TimestampType, StringType) => true
112112
case (TimestampType, DateType) => true

0 commit comments

Comments
 (0)