EmilyMatt opened a new issue, #1391: URL: https://github.com/apache/datafusion-comet/issues/1391
### Describe the bug In here https://github.com/apache/datafusion-comet/blob/f099e6e40aa18441c7882e5bffd9d6dfb10c6c19/spark/src/main/scala/org/apache/comet/serde/QueryPlanSerde.scala#L2130 We check if staticInvoke's staticObject is an instance of Class[CharVarcharCodegenUtils], so we don't enter the case block for other types, while this is currently saved by having all sorts of checks afterwards, this is still a logic error, as Scala erases generics information. I.e., at runtime, the check that actually happens is not "s.staticObject.isInstanceOf[Class[CharVarcharCodegenUtils]]", which is the expected check the check that runs is "s.staticObject.isInstanceOf[Class]", which will always evaluate to true(more specifically, it will become isInstanceOf[Class[Object]] or something similar). This is very easily fixed by actually comparing staticObject to the class of CharVarcharCodegenUtils, which is also of type Class at runtime instead of using an isInstanceOf check. ### Steps to reproduce _No response_ ### Expected behavior _No response_ ### Additional context _No response_ -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org For additional commands, e-mail: github-h...@datafusion.apache.org