Skip to content

Commit 3861785

Browse files
manuzhangcodex
andcommitted
Enable array-to-string cast coverage for float and binary types
Enable FloatType, DoubleType, and BinaryType in CometCastSuite's ArrayType-to-StringType coverage. Allow ArrayType(BinaryType) casts to string to use the existing native binary string formatting path. Co-authored-by: Codex <codex@openai.com>
1 parent f3387fe commit 3861785

2 files changed

Lines changed: 3 additions & 5 deletions

File tree

spark/src/main/scala/org/apache/comet/expressions/CometCast.scala

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,8 +151,6 @@ object CometCast extends CometExpressionSerde[Cast] with CometExprShim {
151151
case (ArrayType(DataTypes.DateType, _), ArrayType(toElementType, _))
152152
if toElementType != DataTypes.IntegerType && toElementType != DataTypes.StringType =>
153153
unsupported(fromType, toType)
154-
case (dt: ArrayType, DataTypes.StringType) if dt.elementType == DataTypes.BinaryType =>
155-
Incompatible()
156154
case (dt: ArrayType, DataTypes.StringType) =>
157155
isSupported(dt.elementType, DataTypes.StringType, timeZoneId, evalMode)
158156
case (dt: ArrayType, dt1: ArrayType) =>

spark/src/test/scala/org/apache/comet/CometCastSuite.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1555,9 +1555,9 @@ class CometCastSuite extends CometTestBase with AdaptiveSparkPlanHelper {
15551555
IntegerType,
15561556
LongType,
15571557
ShortType,
1558-
// FloatType,
1559-
// DoubleType,
1560-
// BinaryType
1558+
FloatType,
1559+
DoubleType,
1560+
BinaryType,
15611561
DecimalType(10, 2),
15621562
DecimalType(38, 18)).foreach { dt =>
15631563
val input = generateArrays(100, dt)

0 commit comments

Comments
 (0)