rshkv commented on code in PR #40794:
URL: https://github.com/apache/spark/pull/40794#discussion_r1173564024
##########
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:
I'm afraid this breaks existing tests, e.g.:
```scala
class DataSourceV2StrategySuite extends PlanTest with SharedSparkSession {
val attrInts = Seq(
$"cint".int,
$"c.int".int,
```
fails on
```
java.lang.AssertionError: assertion failed: attribute must have single name
part
at scala.Predef$.assert(Predef.scala:223)
at
org.apache.spark.sql.catalyst.dsl.package$ExpressionConversions$DslAttr.s(package.scala:276)
at
org.apache.spark.sql.catalyst.dsl.package$ExpressionConversions$ImplicitAttribute.int(package.scala:296)
at
org.apache.spark.sql.execution.datasources.v2.DataSourceV2StrategySuite.<init>(DataSourceV2StrategySuite.scala:32)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at java.lang.Class.newInstance(Class.java:442)
at org.scalatest.tools.Runner$.genSuiteConfig(Runner.scala:1403)
```
--
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]