You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2022/11/11 03:03:13 UTC
[GitHub] [spark] LuciferYang commented on a diff in pull request #38610: [SPARK-41106][SQL] Reduce collection conversion when create AttributeMap
LuciferYang commented on code in PR #38610:
URL: https://github.com/apache/spark/pull/38610#discussion_r1019789820
##########
sql/catalyst/src/main/scala-2.12/org/apache/spark/sql/catalyst/expressions/AttributeMap.scala:
##########
@@ -31,6 +31,10 @@ object AttributeMap {
new AttributeMap(kvs.map(kv => (kv._1.exprId, kv)).toMap)
}
+ def apply[A](kvs: Iterable[(Attribute, A)]): AttributeMap[A] = {
+ new AttributeMap(kvs.map(kv => (kv._1.exprId, kv)).toMap)
+ }
+
Review Comment:
```
https://github.com/apache/spark/blob/0cb79a4af27eb226a4f7574aa1c8b54412222583/sql/catalyst/src/main/scala-2.12/org/apache/spark/sql/catalyst/expressions/AttributeMap.scala#L26-L32
```
Can we identify the above two as `@ deprecated` now and remove it at an appropriate time(maybe Spark 4.0?)? The new `apply` method is more general.
##########
sql/catalyst/src/main/scala-2.12/org/apache/spark/sql/catalyst/expressions/AttributeMap.scala:
##########
@@ -31,6 +31,10 @@ object AttributeMap {
new AttributeMap(kvs.map(kv => (kv._1.exprId, kv)).toMap)
}
+ def apply[A](kvs: Iterable[(Attribute, A)]): AttributeMap[A] = {
+ new AttributeMap(kvs.map(kv => (kv._1.exprId, kv)).toMap)
+ }
+
Review Comment:
https://github.com/apache/spark/blob/0cb79a4af27eb226a4f7574aa1c8b54412222583/sql/catalyst/src/main/scala-2.12/org/apache/spark/sql/catalyst/expressions/AttributeMap.scala#L26-L32
Can we identify the above two as `@ deprecated` now and remove it at an appropriate time(maybe Spark 4.0?)? The new `apply` method is more general.
--
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