This is an automated email from the ASF dual-hosted git repository.
comphead 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 74345945c fix: Fix None.get in stringDecode when binary child cannot
be converted (#2606)
74345945c is described below
commit 74345945c38218d3cf6bbda136874d0816fc0769
Author: Fu Chen <[email protected]>
AuthorDate: Sun Oct 19 07:25:55 2025 +0800
fix: Fix None.get in stringDecode when binary child cannot be converted
(#2606)
---
spark/src/main/scala/org/apache/comet/serde/strings.scala | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/spark/src/main/scala/org/apache/comet/serde/strings.scala
b/spark/src/main/scala/org/apache/comet/serde/strings.scala
index 795ca9b43..c6f5a8508 100644
--- a/spark/src/main/scala/org/apache/comet/serde/strings.scala
+++ b/spark/src/main/scala/org/apache/comet/serde/strings.scala
@@ -256,12 +256,13 @@ trait CommonStringExprs {
// decode(col, 'utf-8') can be treated as a cast with "try" eval mode
that puts nulls
// for invalid strings.
// Left child is the binary expression.
- CometCast.castToProto(
- expr,
- None,
- DataTypes.StringType,
- exprToProtoInternal(bin, inputs, binding).get,
- CometEvalMode.TRY)
+ val binExpr = exprToProtoInternal(bin, inputs, binding)
+ if (binExpr.isDefined) {
+ CometCast.castToProto(expr, None, DataTypes.StringType, binExpr.get,
CometEvalMode.TRY)
+ } else {
+ withInfo(expr, bin)
+ None
+ }
case _ =>
withInfo(expr, "Comet only supports decoding with 'utf-8'.")
None
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]