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


##########
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:
   Nevermind, column names created with `$"dotted.col"` were still being parsed 
as multi-part. Fixed that in 95741fa.



##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/dsl/package.scala:
##########
@@ -271,14 +271,17 @@ package object dsl {
       override def expr: Expression = Literal(s)
       def attr: UnresolvedAttribute = analysis.UnresolvedAttribute(s)
     }
-    implicit class DslAttr(attr: UnresolvedAttribute) extends 
ImplicitAttribute {
-      def s: String = attr.name
+    implicit class DslAttr(override val attr: UnresolvedAttribute) extends 
ImplicitAttribute {
+      def s: String = {
+        assert(attr.nameParts.length == 1, "attribute must have single name 
part")
+        attr.nameParts.head
+      }
     }
 
     abstract class ImplicitAttribute extends ImplicitOperators {
       def s: String
       def expr: UnresolvedAttribute = attr
-      def attr: UnresolvedAttribute = analysis.UnresolvedAttribute(s)
+      def attr: UnresolvedAttribute = analysis.UnresolvedAttribute(Seq(s))

Review Comment:
   Done in 83b6336. Had update `StringToAttributeConversionHelper.$` as well 
95741fa.



-- 
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: [email protected]

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