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

    https://github.com/apache/spark/pull/21537#discussion_r195284269
  
    --- Diff: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/codegen/CodeGenerator.scala
 ---
    @@ -579,6 +579,22 @@ class CodegenContext {
         s"${fullName}_$id"
       }
     
    +  /**
    +   * Creates an `ExprValue` representing a local java variable of required 
data type.
    +   */
    +  def freshName(name: String, dt: DataType): VariableValue = 
JavaCode.variable(freshName(name), dt)
    --- End diff --
    
    Putting it in `CodeGenerator` is just for convenience that we can save a 
`ctx` parameter. I'm fine to let it in `JavaCode` too if you don't think it's 
verbose.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to