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

    https://github.com/apache/spark/pull/21720#discussion_r201194441
  
    --- Diff: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala
 ---
    @@ -559,8 +574,8 @@ class Analyzer(
               Project(groupByExprsAttr ++ pivotOutputs, secondAgg)
             } else {
               val pivotAggregates: Seq[NamedExpression] = pivotValues.flatMap 
{ value =>
    -            def ifExpr(expr: Expression) = {
    -              If(EqualNullSafe(pivotColumn, value), expr, Literal(null))
    +            def ifExpr(e: Expression) = {
    +              If(EqualNullSafe(pivotColumn, Cast(value, 
pivotColumn.dataType)), e, Literal(null))
    --- End diff --
    
    Is it required in the other Cast(value, pivotColumn.dataType) above?


---

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

Reply via email to