You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "rshkv (via GitHub)" <gi...@apache.org> on 2023/04/20 20:03:02 UTC

[GitHub] [spark] rshkv commented on a diff in pull request #40794: [SPARK-43142] Fix DSL expressions on attributes with special characters

rshkv commented on code in PR #40794:
URL: https://github.com/apache/spark/pull/40794#discussion_r1173035633


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/dsl/package.scala:
##########
@@ -271,7 +271,7 @@ package object dsl {
       override def expr: Expression = Literal(s)
       def attr: UnresolvedAttribute = analysis.UnresolvedAttribute(s)
     }
-    implicit class DslAttr(attr: UnresolvedAttribute) extends ImplicitAttribute {
+    implicit class DslAttr(override val attr: UnresolvedAttribute) extends ImplicitAttribute {
       def s: String = attr.name

Review Comment:
   Made the change in 1629228. That alone fixes my problem because `UnresolvedAttribute(Seq(s))` doesn't go through `parseMultipartIdentifier` which drops the backticks. 
   
   I kept the `override val` as it seems unnecessary to create a new `UnresolvedAttribute` if `DslAttr` already wraps one. But happy to revert and just go with the change you proposed.



-- 
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-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org