Skip to content

Commit f7452fa

Browse files
committed
[SPARK-8995] removed old timestamp parsing
1 parent 30e5aec commit f7452fa

File tree

1 file changed

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

1 file changed

+1
-11
lines changed

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

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -167,17 +167,7 @@ case class Cast(child: Expression, dataType: DataType) extends UnaryExpression w
167167
buildCast[UTF8String](_, utfs => {
168168
val parsedDateString = DateTimeUtils.stringToTimestamp(utfs)
169169
if (parsedDateString == null) {
170-
// Throw away extra if more than 9 decimal places
171-
val s = utfs.toString
172-
val periodIdx = s.indexOf(".")
173-
var n = s
174-
if (periodIdx != -1 && n.length() - periodIdx > 9) {
175-
n = n.substring(0, periodIdx + 10)
176-
}
177-
try DateTimeUtils.fromJavaTimestamp(Timestamp.valueOf(n))
178-
catch {
179-
case _: java.lang.IllegalArgumentException => null
180-
}
170+
null
181171
} else {
182172
DateTimeUtils.fromJavaTimestamp(parsedDateString)
183173
}

0 commit comments

Comments
 (0)