mirror of
https://github.com/apache/impala.git
synced 2025-12-30 12:02:10 -05:00
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
25 lines
549 B
Plaintext
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
|
|
====
|