This is an automated email from the ASF dual-hosted git repository.
mbutrovich pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/datafusion-comet.git
The following commit(s) were added to refs/heads/main by this push:
new f1fb98051 fix: Byte array Literals failed on cast (#2432)
f1fb98051 is described below
commit f1fb980518342e91fae8358a4de3d76b7bbf9d4d
Author: Oleks V <[email protected]>
AuthorDate: Sun Sep 21 08:13:22 2025 -0700
fix: Byte array Literals failed on cast (#2432)
---
spark/src/main/scala/org/apache/comet/serde/literals.scala | 4 ++--
.../src/test/scala/org/apache/comet/exec/CometNativeReaderSuite.scala | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/spark/src/main/scala/org/apache/comet/serde/literals.scala
b/spark/src/main/scala/org/apache/comet/serde/literals.scala
index 2eae01e59..c18755e07 100644
--- a/spark/src/main/scala/org/apache/comet/serde/literals.scala
+++ b/spark/src/main/scala/org/apache/comet/serde/literals.scala
@@ -131,8 +131,8 @@ object CometLiteral extends CometExpressionSerde[Literal]
with Logging {
})
case ByteType =>
array.foreach(v => {
- val casted = v.asInstanceOf[Integer]
- listLiteralBuilder.addByteValues(casted)
+ val casted = v.asInstanceOf[lang.Byte]
+ listLiteralBuilder.addByteValues(casted.intValue())
listLiteralBuilder.addNullMask(casted != null)
})
case ShortType =>
diff --git
a/spark/src/test/scala/org/apache/comet/exec/CometNativeReaderSuite.scala
b/spark/src/test/scala/org/apache/comet/exec/CometNativeReaderSuite.scala
index 63164c0fc..84a326c79 100644
--- a/spark/src/test/scala/org/apache/comet/exec/CometNativeReaderSuite.scala
+++ b/spark/src/test/scala/org/apache/comet/exec/CometNativeReaderSuite.scala
@@ -468,7 +468,7 @@ class CometNativeReaderSuite extends CometTestBase with
AdaptiveSparkPlanHelper
"""
|select 1 a
|""".stripMargin,
- "select array(1, 2, null, 3, null) from tbl")
+ "select array(cast(1 as byte), cast(2 as byte), null, cast(3 as byte),
null) from tbl")
}
test("native reader - support ARRAY literal SHORT fields") {
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]