Files
impala/testdata/workloads/functional-query/queries/QueryTest/random.test
Jinchul 4feb4f3a54 IMPALA-5754: Improve randomness of rand()/random()
Currently implementation of rand/random built-in functions
use rand_r of C library. We recognized its randomness was poor.
pcg32 of third party library shows better randomness than rand_r.

Testing:
Revise unit test in expr-test
Add E2E test to random.test

Change-Id: Idafdd5fe7502ff242c76a91a815c565146108684
Reviewed-on: http://gerrit.cloudera.org:8080/8355
Reviewed-by: Jim Apple <jbapple-impala@apache.org>
Tested-by: Impala Public Jenkins
2017-12-13 10:04:40 +00:00

25 lines
549 B
Plaintext

# 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
====