sarutak commented on a change in pull request #33106:
URL: https://github.com/apache/spark/pull/33106#discussion_r659413386



##########
File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/collectionOperations.scala
##########
@@ -181,16 +181,31 @@ case class MapKeys(child: Expression)
   """,
   group = "array_funcs",
   since = "2.4.0")
-case class ArraysZip(children: Seq[Expression]) extends Expression with 
ExpectsInputTypes {
+case class ArraysZip(children: Seq[Expression], names: Seq[String])
+  extends Expression with ExpectsInputTypes {
+
+  def this(children: Seq[Expression]) = {
+    this(
+      children,
+      children.zipWithIndex.map {
+        case (u: UnresolvedAttribute, _) => u.nameParts.last
+        case (a: Alias, _) => a.name
+        case (a: Attribute, _) => a.name
+        case (_, idx) => idx.toString

Review comment:
       Thank you for your suggestion but I don't think we should do it at least 
in this PR because it breaks 
[compatibility](https://github.com/apache/spark/blob/a7369b3080ec3d76957df63cf905a68e41197ba3/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/collectionOperations.scala#L193)
   




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

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



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

Reply via email to