Github user rxin commented on a diff in the pull request:
https://github.com/apache/spark/pull/13421#discussion_r65268708
--- Diff:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/codegen/CodeGenerator.scala
---
@@ -720,15 +721,23 @@ class CodegenContext {
/**
* Register a comment and return the corresponding place holder
*/
- def registerComment(text: String): String = {
- val name = freshName("c")
- val comment = if (text.contains("\n") || text.contains("\r")) {
- text.split("(\r\n)|\r|\n").mkString("/**\n * ", "\n * ", "\n */")
+ def registerComment(text: => String): String = {
+ // By default, disable comments in generated code because computing
the comments themselves can
+ // 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)) {
--- End diff --
basically the change would be larger, but i think immutable configs like
this make this feature pretty much dead.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]