sarutak commented on a change in pull request #31754:
URL: https://github.com/apache/spark/pull/31754#discussion_r589551867



##########
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:
       I think, this is correct.
   If a backtick is a part of attribute name, it should be escaped with an 
additional backtick.
   Then, an attribute name which contains escaped backticks should be enclosed 
by backticks.
   MySQL handles such case with the same manner.
   https://dev.mysql.com/doc/refman/8.0/en/identifiers.html




----------------------------------------------------------------
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]

Reply via email to