-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-21845] [SQL] Make codegen fallback of expressions configurable #19062
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -56,14 +56,10 @@ abstract class SparkPlan extends QueryPlan[SparkPlan] with Logging with Serializ | |
|
|
||
| protected def sparkContext = sqlContext.sparkContext | ||
|
|
||
| // 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) { | ||
| sqlContext.conf.subexpressionEliminationEnabled | ||
| } else { | ||
| false | ||
| } | ||
| // whether we should fallback when hitting compilation errors caused by codegen | ||
| private val codeGenFallBack = sqlContext.conf.codegenFallback | ||
|
|
||
| protected val subexpressionEliminationEnabled = sqlContext.conf.subexpressionEliminationEnabled | ||
|
|
||
| /** Overridden make copy also propagates sqlContext to copied plan. */ | ||
| override def makeCopy(newArgs: Array[AnyRef]): SparkPlan = { | ||
|
|
@@ -370,8 +366,7 @@ abstract class SparkPlan extends QueryPlan[SparkPlan] with Logging with Serializ | |
| try { | ||
| GeneratePredicate.generate(expression, inputSchema) | ||
| } catch { | ||
| case e @ (_: JaninoRuntimeException | _: CompileException) | ||
| if sqlContext == null || sqlContext.conf.wholeStageFallback => | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Because
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Better to put this comment in https://github.com/apache/spark/pull/19062/files#diff-b9f96d092fb3fea76bcf75e016799678R57?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Removing the null check here makes sense although this means existing spark jobs that were previously switching to the non-codegen version even with |
||
| case _ @ (_: JaninoRuntimeException | _: CompileException) if codeGenFallBack => | ||
| genInterpretedPredicate(expression, inputSchema) | ||
| } | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -51,6 +51,7 @@ object TestHive | |
| "TestSQLContext", | ||
| new SparkConf() | ||
| .set("spark.sql.test", "") | ||
| .set(SQLConf.CODEGEN_FALLBACK.key, "false") | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Turn it false to ensure it does not hide the actual bugs of our expression codegen that causes compilation falure. |
||
| .set("spark.sql.hive.metastore.barrierPrefixes", | ||
| "org.apache.spark.sql.hive.execution.PairSerDe") | ||
| .set("spark.sql.warehouse.dir", TestHiveContext.makeWarehouseDir().toURI.getPath) | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.