Github user cloud-fan commented on a diff in the pull request:
https://github.com/apache/spark/pull/10757#discussion_r53004557
--- Diff:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/util/package.scala ---
@@ -130,19 +133,28 @@ package object util {
ret
}
+ // 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 e @ GetStructField(child, _, Some(name)) =>
PrettyGetStructField(child, name, e.dataType)
--- End diff --
can we also turn `GetStructField` to `PrettyAttribute` here? We can
generate the sql string here and pass it as the name of `PrettyAttribute`
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]