vladimirg-db commented on code in PR #50804: URL: https://github.com/apache/spark/pull/50804#discussion_r2077114892
########## sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/util/package.scala: ########## @@ -93,22 +94,37 @@ package object util extends Logging { // Replaces attributes, string literals, complex type extractors with their pretty form so that // generated column names don't contain back-ticks or double-quotes. - def usePrettyExpression(e: Expression): Expression = e transform { - case a: Attribute => new PrettyAttribute(a) - case Literal(s: UTF8String, StringType) => PrettyAttribute(s.toString, StringType) - case Literal(v, t: NumericType) if v != null => PrettyAttribute(v.toString, t) - case Literal(null, dataType) => PrettyAttribute("NULL", dataType) - case e: GetStructField => - val name = e.name.getOrElse(e.childSchema(e.ordinal).name) - PrettyAttribute(usePrettyExpression(e.child).sql + "." + name, e.dataType) - case e: GetArrayStructFields => - PrettyAttribute(s"${usePrettyExpression(e.child)}.${e.field.name}", e.dataType) - case r: InheritAnalysisRules => - PrettyAttribute(r.makeSQLString(r.parameters.map(toPrettySQL)), r.dataType) - case c: Cast if c.getTagValue(Cast.USER_SPECIFIED_CAST).isEmpty => - PrettyAttribute(usePrettyExpression(c.child).sql, c.dataType) - case p: PythonFuncExpression => PrettyPythonUDF(p.name, p.dataType, p.children) - } + private def usePrettyExpression(e: Expression, stripOuterReference: Boolean = true): Expression = + e transform { + case aggregateExpression: AggregateExpression Review Comment: Let's improve the scaladoc by explaining this specific logic. Also, let's make the scaladoc like this: `/** ... */` -- 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: reviews-unsubscr...@spark.apache.org 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