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 2017/12/14 17:48:39 UTC

[2/8] impala git commit: IMPALA-5754: Improve randomness of rand()/random()

http://git-wip-us.apache.org/repos/asf/impala/blob/4feb4f3a/bin/run_clang_tidy.sh
----------------------------------------------------------------------
diff --git a/bin/run_clang_tidy.sh b/bin/run_clang_tidy.sh
index e879b35..36d46ce 100755
--- a/bin/run_clang_tidy.sh
+++ b/bin/run_clang_tidy.sh
@@ -38,7 +38,8 @@ fi
 DIRS=$(ls -d "${IMPALA_HOME}/be/src/"*/ | grep -v gutil | grep -v kudu |\
   grep -v thirdparty | tr '\n' ' ')
 # Include/exclude select thirdparty dirs.
-DIRS=$DIRS$(ls -d "${IMPALA_HOME}/be/src/thirdparty/"*/ | grep -v mpfit | tr '\n' ' ')
+DIRS=$DIRS$(ls -d "${IMPALA_HOME}/be/src/thirdparty/"*/ | grep -v mpfit |\
+  grep -v pcg-cpp | tr '\n' ' ')
 PIPE_DIRS=$(echo "${DIRS}" | tr ' ' '|')
 
 # Reduce the concurrency to one less than the number of cores in the system. Note than

http://git-wip-us.apache.org/repos/asf/impala/blob/4feb4f3a/testdata/workloads/functional-query/queries/QueryTest/alloc-fail-init.test
----------------------------------------------------------------------
diff --git a/testdata/workloads/functional-query/queries/QueryTest/alloc-fail-init.test b/testdata/workloads/functional-query/queries/QueryTest/alloc-fail-init.test
index fe4fa87..5130cdb 100644
--- a/testdata/workloads/functional-query/queries/QueryTest/alloc-fail-init.test
+++ b/testdata/workloads/functional-query/queries/QueryTest/alloc-fail-init.test
@@ -43,7 +43,7 @@ FunctionContext::Allocate() failed to allocate 1 bytes.
 ---- QUERY
 select rand() from functional.alltypes;
 ---- CATCH
-FunctionContext::Allocate() failed to allocate 4 bytes.
+FunctionContext::Allocate() failed to allocate 16 bytes.
 ====
 ---- QUERY
 select case when min(int_col) = 0 then 0 end from functional.alltypes

http://git-wip-us.apache.org/repos/asf/impala/blob/4feb4f3a/testdata/workloads/functional-query/queries/QueryTest/random.test
----------------------------------------------------------------------
diff --git a/testdata/workloads/functional-query/queries/QueryTest/random.test b/testdata/workloads/functional-query/queries/QueryTest/random.test
new file mode 100644
index 0000000..19d2611
--- /dev/null
+++ b/testdata/workloads/functional-query/queries/QueryTest/random.test
@@ -0,0 +1,24 @@
+# These computations take a while so we do not want to add too many test cases
+# They also require a non-trivial amount of data to get reasonable results.
+====
+---- QUERY
+select count(distinct rand()), count(*) from alltypes a;
+---- TYPES
+bigint, bigint
+---- RESULTS
+7300,7300
+====
+---- QUERY
+select count(distinct rand(100)), count(*) from alltypes a;
+---- TYPES
+bigint, bigint
+---- RESULTS
+7300,7300
+====
+---- QUERY
+select count(distinct rand()), count(*) from alltypes a, alltypes b;
+---- TYPES
+bigint, bigint
+---- RESULTS
+53290000,53290000
+====

http://git-wip-us.apache.org/repos/asf/impala/blob/4feb4f3a/tests/query_test/test_queries.py
----------------------------------------------------------------------
diff --git a/tests/query_test/test_queries.py b/tests/query_test/test_queries.py
index 3caeebe..997b59a 100644
--- a/tests/query_test/test_queries.py
+++ b/tests/query_test/test_queries.py
@@ -172,6 +172,12 @@ class TestQueriesTextTables(ImpalaTestSuite):
     vector.get_value('exec_option')['num_nodes'] = 1
     self.run_test_case('QueryTest/distinct-estimate', vector)
 
+  def test_random(self, vector):
+    # These results will vary slightly depending on how the values get split up
+    # so only run with 1 node and on text.
+    vector.get_value('exec_option')['num_nodes'] = 1
+    self.run_test_case('QueryTest/random', vector)
+
   def test_mixed_format(self, vector):
     self.run_test_case('QueryTest/mixed-format', vector)