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

    https://github.com/apache/spark/pull/21537#discussion_r197065708
  
    --- Diff: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/codegen/javaCode.scala
 ---
    @@ -256,6 +283,22 @@ object EmptyBlock extends Block with Serializable {
       override def + (other: Block): Block = other
     }
     
    +/**
    + * A block inlines all types of input arguments into a string without
    + * tracking any reference of `JavaCode` instances.
    + */
    +case class InlineBlock(block: String) extends Block {
    +  override val code: String = block
    +  override val exprValues: Set[ExprValue] = Set.empty
    +
    +  override def + (other: Block): Block = other match {
    +    case c: CodeBlock => Blocks(Seq(this, c))
    +    case i: InlineBlock => InlineBlock(block + i.block)
    --- End diff --
    
    That said, I don't think we should have an usage like:
    ```
    val inline1 = InlineBlock(".....")
    val inline2 = inline1 + InlineBlock(".....")
    code"""
         | $inline2
         | ...
       """.stripMargin
    ```
    
    



---

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

Reply via email to