Uh oh!
There was an error while loading. Please reload this page.
[SPARK-21845] [SQL] Make codegen fallback of expressions configurable - #19062
[SPARK-21845] [SQL] Make codegen fallback of expressions configurable#19062gatorsmile wants to merge 3 commits into
Conversation
| GeneratePredicate.generate(expression, inputSchema) | ||
| } catch { | ||
| case e @ (_: JaninoRuntimeException | _: CompileException) | ||
| if sqlContext == null || sqlContext.conf.wholeStageFallback => |
There was a problem hiding this comment.
Because sqlContext is always null when running it in executors, and thus, this always return true.
There was a problem hiding this comment.
Better to put this comment in https://github.com/apache/spark/pull/19062/files#diff-b9f96d092fb3fea76bcf75e016799678R57?
There was a problem hiding this comment.
Removing the null check here makes sense although this means existing spark jobs that were previously switching to the non-codegen version even with sqlContext.conf.wholeStageFallback = false will now start failing at runtime (perhaps, rightly so). Might be worth calling this out in the 2.3 release notes and/or the migration guide.
| "TestSQLContext", | ||
| new SparkConf() | ||
| .set("spark.sql.test", "") | ||
| .set(SQLConf.CODEGEN_FALLBACK.key, "false") |
There was a problem hiding this comment.
Turn it false to ensure it does not hide the actual bugs of our expression codegen that causes compilation falure.
gatorsmile
commented
Aug 26, 2017
| final val sqlContext = SparkSession.getActiveSession.map(_.sqlContext).orNull | ||
| // whether we should fallback when hitting compilation errors caused by codegen | ||
| private val codeGenFallBack = sqlContext == null || sqlContext.conf.codegenFallback |
There was a problem hiding this comment.
Is it better to add !Utils.isTesting && or to drop !Utils.isTesting && from WholeStageCodegenExec to make these conditions consistent?
There was a problem hiding this comment.
Originally, I did it like what you said. However, if using that approach, I need to remove the test case. Then, I think we might just keep using the codegenFallback for controlling it.
SparkQA
commented
Aug 27, 2017
Test build #81158 has finished for PR 19062 at commit
|
LGTM |
1 similar comment
maropu
commented
Aug 28, 2017
LGTM |
| // sqlContext will be null when we are being deserialized on the slaves. In this instance | ||
| // the value of subexpressionEliminationEnabled will be set by the deserializer after the | ||
| // constructor has run. | ||
| val subexpressionEliminationEnabled: Boolean = if (sqlContext != null) { |
There was a problem hiding this comment.
cc @marmbrus@cloud-fan Does this sound OK? Currently, our codebase does not check nullability in most places. This value will be always not null when we initialize the value.
SparkQA
commented
Aug 29, 2017
Test build #81229 has finished for PR 19062 at commit
|
SparkQA
commented
Aug 29, 2017
Test build #81230 has finished for PR 19062 at commit
|
gatorsmile
commented
Aug 30, 2017
Thanks! Merging to master. |
srowen
commented
Aug 30, 2017
I think this makes the master build fail @gatorsmile : |
gatorsmile
commented
Aug 30, 2017
Thanks! Let me first revert this PR. |
What changes were proposed in this pull request?
We should make codegen fallback of expressions configurable. So far, it is always on. We might hide it when our codegen have compilation bugs. Thus, we should also disable the codegen fallback when running test cases.
How was this patch tested?
Added test cases