cloud-fan commented on a change in pull request #35248:
URL: https://github.com/apache/spark/pull/35248#discussion_r801720807
##########
File path:
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/orc/OrcUtils.scala
##########
@@ -487,18 +488,18 @@ object OrcUtils extends Logging {
val aggORCValues: Seq[WritableComparable[_]] =
aggregation.aggregateExpressions.zipWithIndex.map {
- case (max: Max, index) =>
- val columnName = max.column.fieldNames.head
+ case (max: Max, index) if max.column.isInstanceOf[NamedReference] =>
Review comment:
this is not caused by this PR, but can we also check the length of field
names to be future proof? We can even create a util object to save duplicated
code:
```
object V2Column {
def unapply(e: org.apache.spark.sql.connector.expressions.Expression):
Option[String] = e match {
case r: NamedReference if r. fieldNames.length == 1 =>
Some(r.fieldNames.head)
case _ => None
}
}
```
--
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]