HyukjinKwon commented on a change in pull request #26279: [SPARK-28382][SQL]
Add array function - unnest
URL: https://github.com/apache/spark/pull/26279#discussion_r343549068
##########
File path:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/generators.scala
##########
@@ -343,6 +343,63 @@ abstract class ExplodeBase extends UnaryExpression with
CollectionGenerator with
}
}
+@ExpressionDescription(
+ usage = "_FUNC_(expr) - Separates the elements of array `expr` into multiple
rows recursively.",
+ examples = """
+ Examples:
+ > SELECT _FUNC_(array(10, 20));
+ 10
+ 20
+ > SELECT _FUNC_(a) FROM VALUES (array(1,2)), (array(3,4)) AS v1(a);
+ 1
+ 2
+ 3
+ 4
+ """,
+ since = "3.0.0")
+case class UnNest(child: Expression) extends UnaryExpression with Generator
with CodegenFallback {
Review comment:
Why can't we reuse `explode` here?
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]