sarutak commented on a change in pull request #31754:
URL: https://github.com/apache/spark/pull/31754#discussion_r597214403
##########
File path:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/unresolved.scala
##########
@@ -159,10 +158,7 @@ case class UnresolvedAttribute(nameParts: Seq[String])
extends Attribute with Un
override def toString: String = s"'$name"
- override def sql: String = name match {
- case ParserUtils.escapedIdentifier(_) |
ParserUtils.qualifiedEscapedIdentifier(_, _) => name
Review comment:
Ah, O.K. According to the comment of `UnresolvedAttribute.apply`,
`UnresolvedAttribute("`a.b`").sql` should return ``` "`a.b`" ```.
```
/**
* Creates an [[UnresolvedAttribute]], parsing segments separated by dots
('.').
*/
```
But I think we can't just restore the logic because the following assertion
fails.
```
val attr4 = UnresolvedAttribute("a`b"::"c.d"::Nil)
assert(attr4.sql === "`a``b`.`c.d`")
```
I also think, the implementation of `UnresolvedAttribute.apply` is wrong.
If, we give ``` "`a.b`" ```, the attribute name should be regarded as ```
`a.b` ``` but it just split by `.` and the name parts are regarded as ``` `a
``` and ``` b` ```.
I have another solution for this issue and open a PR.
--
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]