-
Notifications
You must be signed in to change notification settings - Fork 28.4k
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
[SPARK-22219][SQL] Refactor code to get a value for "spark.sql.codegen.comments" #19449
Conversation
Test build #82520 has finished for PR 19449 at commit
|
@@ -929,7 +929,7 @@ class CodegenContext { | |||
// be extremely expensive in certain cases, such as deeply-nested expressions which operate over | |||
// inputs with wide schemas. For more details on the performance issues that motivated this | |||
// flat, see SPARK-15680. | |||
if (SparkEnv.get != null && SparkEnv.get.conf.getBoolean("spark.sql.codegen.comments", false)) { |
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.
note to other reviewers: for historical context why this was done, see https://github.com/apache/spark/pull/13421/files#r65268674
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.
SQLConf
is based on the active spark session. The active spark session is not always correctly set. Thus, we do not encourage the community to use SQLConf
.
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.
See the PR: #18568
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.
There are places in codebase which do SQLConf.get
(esp. CodeGenerator.scala
which is being modified in this PR). Are you suggesting to change that everywhere like #18568 ? I think it will be good thing to do.
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.
Thank you for your comments. Is it better to pass SQLConf
to the constructor of CodegenContext
?
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.
I am afraid it might require a lot of code changes if we add SQLConf to CodegenContext
.
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.
@tejasapatil Maybe just do nothing now. We need to fix the bugs in active session management first.
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.
Good to hear that
@tejasapatil Could you please let us know when it is available as a PR?
I misunderstood @gatorsmile 's comment. I understood there is no activity to fix active session management.
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.
So far, I do not have a bandwidth to fix it. If anybody is interested in this, please feel free to start it. This requires a design doc at first.
LGTM. There are already multiple places in codegen where |
@@ -929,7 +929,7 @@ class CodegenContext { | |||
// be extremely expensive in certain cases, such as deeply-nested expressions which operate over | |||
// inputs with wide schemas. For more details on the performance issues that motivated this | |||
// flat, see SPARK-15680. |
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.
We should move these comments to the SQLConf description.
When #21299 will be merged, I think that we can revisit this PR. |
Test build #90760 has finished for PR 19449 at commit
|
Hm, shall we leave this closed then? |
Sorry for leaving this for a while. I will update it using |
Test build #93118 has finished for PR 19449 at commit
|
@@ -751,6 +751,12 @@ object SQLConf { | |||
.booleanConf | |||
.createWithDefault(true) | |||
|
|||
val MAX_CASES_BRANCHES = buildConf("spark.sql.codegen.maxCaseBranches") |
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.
?
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.
Oh..., I will remove this
Test build #93148 has finished for PR 19449 at commit
|
retest this please |
Test build #93156 has finished for PR 19449 at commit
|
retest this please |
Test build #93159 has finished for PR 19449 at commit
|
cc @gatorsmile |
1 similar comment
cc @gatorsmile |
Seems okay to me. |
@kiszk looks OK except there's an old comment about moving the comments to the new member you've extracted. |
Test build #93841 has finished for PR 19449 at commit
|
Test build #4225 has finished for PR 19449 at commit
|
retest this please |
Test build #93852 has finished for PR 19449 at commit
|
assert(res.length == 2) | ||
assert(res.forall{ case (_, code) => | ||
code.contains("* Codegend pipeline") && code.contains("// input[")}) | ||
} |
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.
combine these two?
Seq(true, false).foreach { flag =>
...
if (flag) {
...
} else {
...
}
}
Test build #93895 has finished for PR 19449 at commit
|
LGTM pending Jenkins. |
Test build #4229 has finished for PR 19449 at commit
|
retest this please |
Test build #93923 has finished for PR 19449 at commit
|
retest this please |
ok to test |
Test build #93953 has finished for PR 19449 at commit
|
retest this please |
Test build #93982 has finished for PR 19449 at commit
|
retest this please |
Test build #94014 has finished for PR 19449 at commit
|
retest this please |
I think we have a problem in the kafka tests right now that will cause this to fail. Seems to be the cause several times now |
Test build #94049 has finished for PR 19449 at commit
|
Merged to master |
What changes were proposed in this pull request?
This PR refactors code to get a value for "spark.sql.codegen.comments" by avoiding
SparkEnv.get.conf
. This PR usesSQLConf.get.codegenComments
sinceSQLConf.get
always returns an instance ofSQLConf
.How was this patch tested?
Added test case to
DebuggingSuite