Skip to content

Commit 71f89c1

Browse files
committed
[SPARK-8995] minor style fix
1 parent f7452fa commit 71f89c1

File tree

1 file changed

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

1 file changed

+2
-6
lines changed

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

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -166,11 +166,7 @@ case class Cast(child: Expression, dataType: DataType) extends UnaryExpression w
166166
case StringType =>
167167
buildCast[UTF8String](_, utfs => {
168168
val parsedDateString = DateTimeUtils.stringToTimestamp(utfs)
169-
if (parsedDateString == null) {
170-
null
171-
} else {
172-
DateTimeUtils.fromJavaTimestamp(parsedDateString)
173-
}
169+
if (parsedDateString == null) null else DateTimeUtils.fromJavaTimestamp(parsedDateString)
174170
})
175171
case BooleanType =>
176172
buildCast[Boolean](_, b => if (b) 1L else 0)
@@ -221,7 +217,7 @@ case class Cast(child: Expression, dataType: DataType) extends UnaryExpression w
221217
case StringType =>
222218
buildCast[UTF8String](_, s => {
223219
val parsedDate = DateTimeUtils.stringToDate(s)
224-
if (parsedDate == null) null else DateTimeUtils.fromJavaDate (parsedDate)
220+
if (parsedDate == null) null else DateTimeUtils.fromJavaDate(parsedDate)
225221
})
226222
case TimestampType =>
227223
// throw valid precision more than seconds, according to Hive.

0 commit comments

Comments
 (0)