You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by davies <gi...@git.apache.org> on 2016/06/01 00:21:56 UTC

[GitHub] spark pull request: [SPARK-15680][SQL] Disable comments in generated code in...

Github user davies commented on a diff in the pull request:

    https://github.com/apache/spark/pull/13421#discussion_r65285433
  
    --- 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 --
    
    That's sad ...


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org