File: test_sampling_stats.test_slow

package info (click to toggle)
duckdb 1.5.1-3
  • links: PTS, VCS
  • area: main
  • in suites:
  • size: 299,196 kB
  • sloc: cpp: 865,414; ansic: 57,292; python: 18,871; sql: 12,663; lisp: 11,751; yacc: 7,412; lex: 1,682; sh: 747; makefile: 564
file content (35 lines) | stat: -rw-r--r-- 1,373 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# name: test/sql/sample/test_sampling_stats.test_slow
# description: Test SAMPLE keyword
# group: [sample]

statement ok
PRAGMA enable_verification;

set seed 0.42

query I
select (avg::DOUBLE between 550000 and 650000) and (min::INT < 10000) and (max::INT > 1190000)
  and (q25::INT between 230000 and 370000) and (q50::INT between 530000 and 670000) 
  and (q75::INT between 830000 and 970000) and (count::INT = 1500)
  and (std::DOUBLE between 300000 and 400000)
from (summarize select * from generate_series(1,1200000) using sample 1500 (reservoir));
----
true

query I
select (avg::DOUBLE between 580000 and 620000) and (min::INT < 1000) and (max::INT > 1199000)
  and (q25::INT between 280000 and 320000) and (q50::INT between 580000 and 620000) 
  and (q75::INT between 880000 and 920000) and (count::INT = 100000)
  and (std::DOUBLE between 320000 and 370000)
from (summarize select * from generate_series(1,1200000) using sample 100000 (reservoir));
----
true

query I
select (avg::DOUBLE between 580000 and 620000) and (min::INT < 1000) and (max::INT > 1199000)
  and (q25::INT between 280000 and 320000) and (q50::INT between 580000 and 620000) 
  and (q75::INT between 880000 and 920000) and (count::INT = 400000)
  and (std::DOUBLE between 320000 and 370000)
from (summarize select * from generate_series(1,1200000) using sample 400000 (reservoir));
----
true