Github user HyukjinKwon commented on a diff in the pull request:
https://github.com/apache/spark/pull/21034#discussion_r180738834
--- Diff:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/collectionOperations.scala
---
@@ -212,6 +213,96 @@ case class SortArray(base: Expression, ascendingOrder:
Expression)
override def prettyName: String = "sort_array"
}
+/**
+ * Returns a reversed string or an array with reverse order of elements.
+ */
+@ExpressionDescription(
+ usage = "_FUNC_(array) - Returns a reversed string or an array with
reverse order of elements.",
+ examples = """
+ Examples:
+ > SELECT _FUNC_('Spark SQL');
+ LQS krapS
+ > SELECT _FUNC_(array(2, 1, 4, 3));
+ [3, 4, 1, 2]
+ """,
+ since = "2.4.0")
--- End diff --
Hmmm. I think the function `reverse` in SQL is there from 1.5 - SPARK-8258.
Can we use 1.5.0 here and add a note via `note` field? there's an example for
note:
https://github.com/apache/spark/blob/2ce37b50fc01558f49ad22f89c8659f50544ffec/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/regexpExpressions.scala#L101-L103
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]