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

    https://github.com/apache/spark/pull/19563#discussion_r147129483
  
    --- Diff: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/hash.scala
 ---
    @@ -389,9 +389,10 @@ abstract class HashExpression[E] extends Expression {
           input: String,
           result: String,
           fields: Array[StructField]): String = {
    -    fields.zipWithIndex.map { case (field, index) =>
    +    val hashes = fields.zipWithIndex.map { case (field, index) =>
           nullSafeElementHash(input, index.toString, field.nullable, 
field.dataType, result, ctx)
    -    }.mkString("\n")
    +    }
    +    ctx.splitExpressions(hashes, "apply", ("InternalRow", input) :: Nil)
    --- End diff --
    
    then I think that here the best option would be 
`ctx.splitExpressions(input, hashes)` which contains additional safety checks 
and I think is easier.


---

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

Reply via email to