Repository: impala Updated Branches: refs/heads/master 20c161d75 -> 1b706fb32
IMPALA-3282: [DOCS] Adds regexp_escape built-in function Change-Id: Ied8e757c1b3012dd170b05da190d1598004d12cf Reviewed-on: http://gerrit.cloudera.org:8080/10174 Reviewed-by: Alex Rodoni <[email protected]> Tested-by: Impala Public Jenkins <[email protected]> Project: http://git-wip-us.apache.org/repos/asf/impala/repo Commit: http://git-wip-us.apache.org/repos/asf/impala/commit/1b706fb3 Tree: http://git-wip-us.apache.org/repos/asf/impala/tree/1b706fb3 Diff: http://git-wip-us.apache.org/repos/asf/impala/diff/1b706fb3 Branch: refs/heads/master Commit: 1b706fb32b3338b3fe6f37680c32874de101cd44 Parents: 20c161d Author: Jinchul <[email protected]> Authored: Tue Apr 24 18:12:54 2018 +0900 Committer: Impala Public Jenkins <[email protected]> Committed: Wed Apr 25 04:44:23 2018 +0000 ---------------------------------------------------------------------- docs/topics/impala_string_functions.xml | 48 ++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/impala/blob/1b706fb3/docs/topics/impala_string_functions.xml ---------------------------------------------------------------------- diff --git a/docs/topics/impala_string_functions.xml b/docs/topics/impala_string_functions.xml index 9ee2665..73fa236 100644 --- a/docs/topics/impala_string_functions.xml +++ b/docs/topics/impala_string_functions.xml @@ -693,6 +693,54 @@ select instr('foo bar bletch', 'b', 1, null); </dlentry> + <dlentry rev="3.0" id="regexp_escape"> + + <dt> + <codeph>regexp_escape(string source)</codeph> + </dt> + + <dd> + <b>Purpose:</b> The <codeph>regexp_escape</codeph> function returns + a string escaped for the special character in RE2 library so that the + special characters are interpreted literally rather than as special + characters. The following special characters are escaped by the + function: +<codeblock><![CDATA[.\+*?[^]$(){}=!<>|:-]]></codeblock> + + <p> + <b>Return type:</b> + <codeph>string</codeph> + </p> + + <p conref="../shared/impala_common.xml#common/regexp_re2"/> + <p conref="../shared/impala_common.xml#common/regexp_re2_warning"/> + <p conref="../shared/impala_common.xml#common/regexp_escapes"/> + <p conref="../shared/impala_common.xml#common/example_blurb"/> + <p> + This example shows escaping one of special characters in RE2. + </p> +<codeblock> ++------------------------------------------------------+ +| regexp_escape('Hello.world') | ++------------------------------------------------------+ +| Hello\.world | ++------------------------------------------------------+ +</codeblock> + <p> + This example shows escaping all the special characters in RE2. + </p> +<codeblock><![CDATA[ ++------------------------------------------------------------+ +| regexp_escape('a.b\\c+d*e?f[g]h$i(j)k{l}m=n!o<p>q|r:s-t') | ++------------------------------------------------------------+ +| a\.b\\c\+d\*e\?f\[g\]h\$i\(j\)k\{l\}m\=n\!o\<p\>q\|r\:s\-t | ++------------------------------------------------------------+ +]]> +</codeblock> + </dd> + + </dlentry> + <dlentry id="regexp_extract"> <dt>
