You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@beam.apache.org by "Rui Wang (JIRA)" <ji...@apache.org> on 2018/11/02 06:48:00 UTC

[jira] [Created] (BEAM-5945) REVERSE

Rui Wang created BEAM-5945:
------------------------------

             Summary: REVERSE
                 Key: BEAM-5945
                 URL: https://issues.apache.org/jira/browse/BEAM-5945
             Project: Beam
          Issue Type: Sub-task
          Components: dsl-sql
            Reporter: Rui Wang
            Assignee: Rui Wang


REVERSE(value)

Returns the reverse of the input STRING or BYTES.

Return type

STRING or BYTES

Examples

WITH example AS (
  SELECT "foo" AS sample_string, b"bar" AS sample_bytes UNION ALL
  SELECT "абвгд" AS sample_string, b"123" AS sample_bytes
)
SELECT
  sample_string,
  REVERSE(sample_string) AS reverse_string,
  sample_bytes,
  REVERSE(sample_bytes) AS reverse_bytes
FROM example;

+---------------+----------------+--------------+---------------+
| sample_string | reverse_string | sample_bytes | reverse_bytes |
+---------------+----------------+--------------+---------------+
| foo           | oof            | bar          | rab           |
| абвгд         | дгвба          | 123          | 321           |
+---------------+----------------+--------------+---------------+



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)