Skip to content

Commit 11651d4

Browse files
fix: Passthrough condition in StaticInvoke case block (#1392)
* fix invalid evaluation * update comment --------- Co-authored-by: Emily Matheys <[email protected]>
1 parent 4fe4f57 commit 11651d4

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

spark/src/main/scala/org/apache/comet/serde/QueryPlanSerde.scala

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2128,7 +2128,9 @@ object QueryPlanSerde extends Logging with ShimQueryPlanSerde with CometExprShim
21282128
// char types.
21292129
// See https://github.com/apache/spark/pull/38151
21302130
case s: StaticInvoke
2131-
if s.staticObject.isInstanceOf[Class[CharVarcharCodegenUtils]] &&
2131+
// classOf gets ther runtime class of T, which lets us compare directly
2132+
// Otherwise isInstanceOf[Class[T]] will always evaluate to true for Class[_]
2133+
if s.staticObject == classOf[CharVarcharCodegenUtils] &&
21322134
s.dataType.isInstanceOf[StringType] &&
21332135
s.functionName == "readSidePadding" &&
21342136
s.arguments.size == 2 &&

0 commit comments

Comments
 (0)