You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@impala.apache.org by ta...@apache.org on 2018/04/25 20:06:44 UTC

[1/2] impala git commit: IMPALA-3282: [DOCS] Adds regexp_escape built-in function

Repository: impala
Updated Branches:
  refs/heads/2.x d983bfacd -> 3acb8f984


IMPALA-3282: [DOCS] Adds regexp_escape built-in function

Change-Id: Ied8e757c1b3012dd170b05da190d1598004d12cf
Reviewed-on: http://gerrit.cloudera.org:8080/10174
Reviewed-by: Alex Rodoni <ar...@cloudera.com>
Tested-by: Impala Public Jenkins <im...@cloudera.com>


Project: http://git-wip-us.apache.org/repos/asf/impala/repo
Commit: http://git-wip-us.apache.org/repos/asf/impala/commit/11500418
Tree: http://git-wip-us.apache.org/repos/asf/impala/tree/11500418
Diff: http://git-wip-us.apache.org/repos/asf/impala/diff/11500418

Branch: refs/heads/2.x
Commit: 115004189aa966aa831074eeffe7951e595516c2
Parents: d983bfa
Author: Jinchul <ji...@gmail.com>
Authored: Tue Apr 24 18:12:54 2018 +0900
Committer: Impala Public Jenkins <im...@gerrit.cloudera.org>
Committed: Wed Apr 25 06:01:18 2018 +0000

----------------------------------------------------------------------
 docs/topics/impala_string_functions.xml | 48 ++++++++++++++++++++++++++++
 1 file changed, 48 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/impala/blob/11500418/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>


[2/2] impala git commit: IMPALA-6902: Tighten udf test to look for crashes

Posted by ta...@apache.org.
IMPALA-6902: Tighten udf test to look for crashes

test_native_functions_race assumes that any exception
is grounds for failing the test. However, the flake described
in IMPALA-6902 shows an example of an exception that causes
a false negative (it should be ignored). This change tightens
the test to fail when an impalad crashes, which was the original
intent of the test.

Tests:
- re-ran test_udfs.py

Change-Id: I7780ff328fde5cf462cf718a1467b8a032d2c17b
Reviewed-on: http://gerrit.cloudera.org:8080/10180
Reviewed-by: Thomas Tauber-Marshall <tm...@cloudera.com>
Tested-by: Impala Public Jenkins <im...@cloudera.com>


Project: http://git-wip-us.apache.org/repos/asf/impala/repo
Commit: http://git-wip-us.apache.org/repos/asf/impala/commit/3acb8f98
Tree: http://git-wip-us.apache.org/repos/asf/impala/tree/3acb8f98
Diff: http://git-wip-us.apache.org/repos/asf/impala/diff/3acb8f98

Branch: refs/heads/2.x
Commit: 3acb8f984e819ea5ca11624b3df8f2f60562ff5a
Parents: 1150041
Author: Vuk Ercegovac <ve...@cloudera.com>
Authored: Tue Apr 24 14:14:27 2018 -0700
Committer: Impala Public Jenkins <im...@gerrit.cloudera.org>
Committed: Wed Apr 25 09:54:12 2018 +0000

----------------------------------------------------------------------
 tests/query_test/test_udfs.py | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/impala/blob/3acb8f98/tests/query_test/test_udfs.py
----------------------------------------------------------------------
diff --git a/tests/query_test/test_udfs.py b/tests/query_test/test_udfs.py
index dc5491b..902914a 100644
--- a/tests/query_test/test_udfs.py
+++ b/tests/query_test/test_udfs.py
@@ -324,6 +324,10 @@ class TestUdfExecution(TestUdfBase):
     drop_another_fn = """drop function if exists {0}.other(float)"""
     udf_path = get_fs_path('/test-warehouse/libTestUdfs.so')
 
+    # Tracks number of impalads prior to tests to check that none have crashed.
+    cluster = ImpalaCluster()
+    exp_num_impalads = len(cluster.impalads)
+
     setup_client = self.create_impala_client()
     setup_query = create_fn_to_use.format(unique_database, udf_path)
     try:
@@ -372,9 +376,11 @@ class TestUdfExecution(TestUdfBase):
     # join all threads.
     for t in runner_threads: t.join();
 
-    # Check for any errors.
     for e in errors: print e
-    assert len(errors) == 0
+
+    # Checks that no impalad has crashed.
+    cluster.refresh()
+    assert len(cluster.impalads) == exp_num_impalads
 
   def test_ir_functions(self, vector, unique_database):
     if vector.get_value('exec_option')['disable_codegen']: