reverse
function
Applies to: Databricks SQL Databricks Runtime
Returns a reversed string or an array with reverse order of elements.
Syntax
reverse(expr)
Arguments
expr
: ASTRING
orARRAY
expression.
Returns
The result type matches the type of expr
.
Examples
> SELECT reverse('Spark SQL');
LQS krapS
> SELECT reverse(array(2, 1, 4, 3));
[3,4,1,2]