Github user gatorsmile commented on a diff in the pull request:
https://github.com/apache/spark/pull/21720#discussion_r200831720
--- 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 --
need to consider timezone. `Cast(value, pivotColumn.dataType,
Some(conf.sessionLocalTimeZone))`
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]