This is an automated email from the ASF dual-hosted git repository.

yumwang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/spark.git


The following commit(s) were added to refs/heads/master by this push:
     new 3523d83ac47 Revert "[SPARK-43142] Fix DSL expressions on attributes 
with special characters"
3523d83ac47 is described below

commit 3523d83ac472b330bb86a442365c0a15f7e53f8c
Author: Yuming Wang <yumw...@ebay.com>
AuthorDate: Fri Apr 21 22:50:50 2023 +0800

    Revert "[SPARK-43142] Fix DSL expressions on attributes with special 
characters"
    
    This reverts commit eb6c88583c816f6a1b060b5e8268e450430f1310.
---
 .../scala/org/apache/spark/sql/catalyst/dsl/package.scala   | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)

diff --git 
a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/dsl/package.scala 
b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/dsl/package.scala
index bc0891410a6..ac439203cb7 100644
--- 
a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/dsl/package.scala
+++ 
b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/dsl/package.scala
@@ -190,7 +190,7 @@ package object dsl {
       // Note that if we make ExpressionConversions an object rather than a 
trait, we can
       // then make this a value class to avoid the small penalty of runtime 
instantiation.
       def $(args: Any*): analysis.UnresolvedAttribute = {
-        analysis.UnresolvedAttribute(Seq(sc.s(args : _*)))
+        analysis.UnresolvedAttribute(sc.s(args : _*))
       }
     }
 
@@ -269,19 +269,16 @@ package object dsl {
     // TODO more implicit class for literal?
     implicit class DslString(val s: String) extends ImplicitOperators {
       override def expr: Expression = Literal(s)
-      def attr: UnresolvedAttribute = analysis.UnresolvedAttribute(Seq(s))
+      def attr: UnresolvedAttribute = analysis.UnresolvedAttribute(s)
     }
-    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
-      }
+    implicit class DslAttr(attr: UnresolvedAttribute) extends 
ImplicitAttribute {
+      def s: String = attr.name
     }
 
     abstract class ImplicitAttribute extends ImplicitOperators {
       def s: String
       def expr: UnresolvedAttribute = attr
-      def attr: UnresolvedAttribute = analysis.UnresolvedAttribute(Seq(s))
+      def attr: UnresolvedAttribute = analysis.UnresolvedAttribute(s)
 
       /** Creates a new AttributeReference of type boolean */
       def boolean: AttributeReference = AttributeReference(s, BooleanType, 
nullable = true)()


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@spark.apache.org
For additional commands, e-mail: commits-h...@spark.apache.org

Reply via email to