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



##########
File path: 
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/DataSourceStrategy.scala
##########
@@ -706,21 +706,21 @@ object DataSourceStrategy
     if (agg.filter.isEmpty) {
       agg.aggregateFunction match {
         case aggregate.Min(PushableColumnWithoutNestedColumn(name)) =>
-          Some(new Min(FieldReference(name)))
+          Some(new Min(FieldReference(s"`$name`")))

Review comment:
       We know it's a top-level column and it's a waste to parse it again. The 
column name may contain backtick as well and we need to escape it.
   
   A simpler solution is to skip the parsing: `FieldReference(Seq(name))`. We 
can even create an util method for it: `FieldReference.column(name)`




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