cfmcgrady commented on a change in pull request #33106:
URL: https://github.com/apache/spark/pull/33106#discussion_r659311441
##########
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:
Shall we add `_` for column name `idx` when the children are other
expressions? e.g. `_1`,` _2`. As I know Spark auto-generate schema always
starts with an underline, such as read a CSV file without headers.
--
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]