diff --git a/spark/src/main/scala/org/apache/comet/expressions/CometCast.scala b/spark/src/main/scala/org/apache/comet/expressions/CometCast.scala index 51749f1b8..613d35991 100644 --- a/spark/src/main/scala/org/apache/comet/expressions/CometCast.scala +++ b/spark/src/main/scala/org/apache/comet/expressions/CometCast.scala @@ -33,6 +33,11 @@ object CometCast { toType: DataType, timeZoneId: Option[String], evalMode: String): Boolean = { + + if (fromType == toType) { + return true + } + (fromType, toType) match { case (DataTypes.StringType, _) => canCastFromString(cast, toType)