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

    https://github.com/apache/spark/pull/21193#discussion_r186679018
  
    --- Diff: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/codegen/javaCode.scala
 ---
    @@ -114,6 +114,113 @@ object JavaCode {
       }
     }
     
    +/**
    + * A trait representing a block of java code.
    + */
    +trait Block extends JavaCode {
    +
    +  // The expressions to be evaluated inside this block.
    +  def exprValues: Seq[ExprValue]
    +
    +  // Returns java code string for this code block.
    +  override def toString: String = _marginChar match {
    +    case Some(c) => code.stripMargin(c).trim
    +    case _ => code.trim
    +  }
    +
    +  // The leading prefix that should be stripped from each line.
    +  // By default we strip blanks or control characters followed by '|' from 
the line.
    +  var _marginChar: Option[Char] = Some('|')
    --- End diff --
    
    Like:
    ```scala
      code"""
       | val ...
       | ...
      """.stripMargin
    ```
    
    It's basically for compatibility. We can remove this and disallow 
`stripMargin(customPrefix)`. WDYT?
    



---

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

Reply via email to