Skip to content

Commit

Permalink
Document the func
Browse files Browse the repository at this point in the history
  • Loading branch information
PHILO-HE committed Mar 26, 2024
1 parent 2ef9a07 commit 7efd217
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions velox/docs/functions/spark/string.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,18 @@ Unless specified otherwise, all functions return NULL if at least one of the arg
If ``n < 0``, the result is an empty string.
If ``n >= 256``, the result is equivalent to chr(``n % 256``).

.. spark:function:: concat_ws(separator, [array<string>]/[string], ...) -> varchar
Returns the concatenation of the strings separated by ``separator``. If ``separator`` is NULL, the
result is NULL, regardless of the following inputs. If only ``separator`` (not a NULL) is provided,
or all remaining inputs are NULL, returns an empty string. ::

SELECT concat_ws(',', 'a', 'b', 'c'); -- 'a,b,c'
SELECT concat_ws(',', ['a', 'b', 'c']); -- 'a,b,c'
SELECT concat_ws(NULL, 'a'); -- NULL
SELECT concat_ws(','); -- ''
SELECT concat_ws(',', NULL, NULL); -- ''

.. spark:function:: contains(left, right) -> boolean
Returns true if 'right' is found in 'left'. Otherwise, returns false. ::
Expand Down

0 comments on commit 7efd217

Please sign in to comment.