HeartSaVioR commented on a change in pull request #27872: [SPARK-31115][SQL]
Provide config to avoid using switch statement in generated code to avoid
Janino bug
URL: https://github.com/apache/spark/pull/27872#discussion_r391275141
##########
File path:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/predicates.scala
##########
@@ -454,7 +454,9 @@ case class InSet(child: Expression, hset: Set[Any])
extends UnaryExpression with
}
override def doGenCode(ctx: CodegenContext, ev: ExprCode): ExprCode = {
- if (canBeComputedUsingSwitch && hset.size <=
SQLConf.get.optimizerInSetSwitchThreshold) {
+ val sqlConf = SQLConf.get
+ if (canBeComputedUsingSwitch && hset.size <=
sqlConf.optimizerInSetSwitchThreshold &&
+ sqlConf.codegenUseSwitchStatement) {
Review comment:
Yeah it would be ideal. Thanks! I over-thought a bit and thought it would be
hard to deal with it, but looks like not that complicated. Let me update the
code and PR information.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]