From d2558790e91114d38c3591870f885d4df68f13b2 Mon Sep 17 00:00:00 2001 From: Andy Grove Date: Wed, 1 May 2024 15:07:51 -0600 Subject: [PATCH] always cast between same type --- .../main/scala/org/apache/comet/expressions/CometCast.scala | 5 +++++ 1 file changed, 5 insertions(+) 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)