sarutak commented on a change in pull request #31754:
URL: https://github.com/apache/spark/pull/31754#discussion_r589557510
##########
File path:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/unresolved.scala
##########
@@ -141,8 +140,7 @@ case class UnresolvedTableValuedFunction(
*/
case class UnresolvedAttribute(nameParts: Seq[String]) extends Attribute with
Unevaluable {
- def name: String =
- nameParts.map(n => if (n.contains(".")) s"`$n`" else n).mkString(".")
+ def name: String = nameParts.map(n => if (n.contains(".")) s"`$n`" else
n).mkString(".")
Review comment:
One example.
If we'd like to express an attribute ``` `a.b` ``` where two backticks are
parts of the attribute name.
```
spark.sql("select 'Hello' as `a.b`").show
```
is incorrect because the attribute name will be `a.b`.
```
spark.sql("select 'Hello' as `he``llo`").show
```
is correct and this quote style is what `UnresolvedAttribute.sql` provides
with this change.
----------------------------------------------------------------
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:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]