cloud-fan commented on a change in pull request #35248:
URL: https://github.com/apache/spark/pull/35248#discussion_r802399880



##########
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:
       OK at least we can make a util function
   ```
   object V2ColumnUtils {
     def extractV2Column(expr: V2Expression): Option[String] = ...
   }
   ```
   and here we can write
   ```
   case (max: Max, index) if 
V2ColumnUtils.extractV2Column(max.column).isDefined =>
     val columnName = V2ColumnUtils.extractV2Column(max.column).get
     ...
   ```




-- 
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]

Reply via email to