cloud-fan commented on a change in pull request #29626: URL: https://github.com/apache/spark/pull/29626#discussion_r484184462
########## File path: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/RewriteDistinctAggregates.scala ########## @@ -293,12 +297,16 @@ object RewriteDistinctAggregates extends Rule[LogicalPlan] { val operators = expressions.map { e => val af = e.aggregateFunction val naf = patchAggregateFunctionChildren(af) { x => - val condition = if (e.filter.isDefined) { - e.filter.map(distinctAggFilterAttrLookup.get(_)).get + val condition = e.filter.map(distinctAggFilterAttrLookup.get(_)).getOrElse(None) Review comment: nit: is `.getOrElse(None)` needed? ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org