Skip to content

Commit 0e0a4f5

Browse files
committed
minor format
1 parent 4ddcb92 commit 0e0a4f5

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/HiveTypeCoercion.scala

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -244,12 +244,12 @@ trait HiveTypeCoercion {
244244
case p: BinaryPredicate if p.left.dataType != StringType && p.right.dataType == StringType =>
245245
p.makeCopy(Array(p.left, Cast(p.right, DoubleType)))
246246

247-
case i @ In(a,b) if a.dataType == DateType && b.forall(_.dataType == StringType) =>
248-
i.makeCopy(Array(a,b.map(Cast(_,DateType))))
249-
case i @ In(a,b) if a.dataType == TimestampType && b.forall(_.dataType == StringType) =>
250-
i.makeCopy(Array(a,b.map(Cast(_,TimestampType))))
251-
case i @ In(a,b) if a.dataType == DateType && b.forall(_.dataType == TimestampType) =>
252-
i.makeCopy(Array(a,b.map(Cast(_,DateType))))
247+
case i @ In(a, b) if a.dataType == DateType && b.forall(_.dataType == StringType) =>
248+
i.makeCopy(Array(a, b.map(Cast(_, DateType))))
249+
case i @ In(a, b) if a.dataType == TimestampType && b.forall(_.dataType == StringType) =>
250+
i.makeCopy(Array(a, b.map(Cast(_, TimestampType))))
251+
case i @ In(a, b) if a.dataType == DateType && b.forall(_.dataType == TimestampType) =>
252+
i.makeCopy(Array(a, b.map(Cast(_, DateType))))
253253

254254
case Sum(e) if e.dataType == StringType =>
255255
Sum(Cast(e, DoubleType))

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,8 +163,7 @@ case class Cast(child: Expression, dataType: DataType) extends UnaryExpression w
163163
case TimestampType =>
164164
buildCast[Timestamp](_, t => Date.valueOf(timestampToDateString(t)))
165165
// TimestampWritable.decimalToDate
166-
case _ =>
167-
_ => null
166+
case _ => _ => null
168167
}
169168

170169
// Date cannot be cast to long, according to hive

0 commit comments

Comments
 (0)