tdcmeehan commented on code in PR #58235:
URL: https://github.com/apache/spark/pull/58235#discussion_r3935511881
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/aggregate/PivotFirst.scala:
##########
@@ -88,11 +89,27 @@ case class PivotFirst(
private val usesTreeMap: Boolean =
!TypeUtils.typeWithProperEquals(pivotColumn.dataType)
- val pivotIndex: Map[Any, Int] = if (usesTreeMap) {
- TreeMap(pivotColumnValues.zipWithIndex: _*)(
- TypeUtils.getInterpretedOrdering(pivotColumn.dataType))
- } else {
- HashMap(pivotColumnValues.zipWithIndex: _*)
+ // Every pivot value gets a buffer slot, shared between the values that
compare as equal, so a
+ // repeated value does not shrink the buffer below the number of output
columns.
Review Comment:
```suggestion
// Every pivot value gets a buffer slot, shared between the values that
compare as equal, so
// repeated values shrink the buffer below the number of output columns
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]