Skip to content

Commit 95a4eff

Browse files
committed
fix test
1 parent dad9ce1 commit 95a4eff

File tree

4 files changed

+56
-56
lines changed

4 files changed

+56
-56
lines changed

datafusion/core/tests/dataframe/mod.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1206,23 +1206,23 @@ async fn window_using_aggregates() -> Result<()> {
12061206
| | | | | | | | 1 | -85 |
12071207
| -85 | -101 | 14 | -12 | -12 | 83 | -101 | 4 | -54 |
12081208
| -85 | -101 | 17 | -25 | -25 | 83 | -101 | 5 | -31 |
1209-
| -85 | -12 | 10 | -32 | -34 | 83 | -85 | 3 | 13 |
1209+
| -85 | -12 | 10 | -43 | -34 | 83 | -85 | 3 | 13 |
12101210
| -85 | -25 | 3 | -56 | -56 | -25 | -85 | 1 | -5 |
1211-
| -85 | -31 | 18 | -29 | -28 | 83 | -101 | 5 | 36 |
1211+
| -85 | -31 | 18 | -31 | -28 | 83 | -101 | 5 | 36 |
12121212
| -85 | -38 | 16 | -25 | -25 | 83 | -101 | 4 | 65 |
12131213
| -85 | -43 | 7 | -43 | -43 | 83 | -85 | 2 | 45 |
1214-
| -85 | -48 | 6 | -35 | -36 | 83 | -85 | 2 | -43 |
1215-
| -85 | -5 | 4 | -37 | -40 | -5 | -85 | 1 | 83 |
1216-
| -85 | -54 | 15 | -17 | -18 | 83 | -101 | 4 | -38 |
1217-
| -85 | -56 | 2 | -70 | -70 | -56 | -85 | 1 | -25 |
1214+
| -85 | -48 | 6 | -48 | -36 | 83 | -85 | 2 | -43 |
1215+
| -85 | -5 | 4 | -56 | -40 | -5 | -85 | 1 | 83 |
1216+
| -85 | -54 | 15 | -25 | -18 | 83 | -101 | 4 | -38 |
1217+
| -85 | -56 | 2 | -85 | -70 | -56 | -85 | 1 | -25 |
12181218
| -85 | -72 | 9 | -43 | -43 | 83 | -85 | 3 | -12 |
12191219
| -85 | -85 | 1 | -85 | -85 | -85 | -85 | 1 | -56 |
1220-
| -85 | 13 | 11 | -17 | -18 | 83 | -85 | 3 | 14 |
1220+
| -85 | 13 | 11 | -25 | -18 | 83 | -85 | 3 | 14 |
12211221
| -85 | 13 | 11 | -25 | -25 | 83 | -85 | 3 | 13 |
12221222
| -85 | 14 | 12 | -12 | -12 | 83 | -85 | 3 | 17 |
1223-
| -85 | 17 | 13 | -11 | -8 | 83 | -85 | 4 | -101 |
1224-
| -85 | 45 | 8 | -34 | -34 | 83 | -85 | 3 | -72 |
1225-
| -85 | 65 | 17 | -17 | -18 | 83 | -101 | 5 | -101 |
1223+
| -85 | 17 | 13 | -12 | -8 | 83 | -85 | 4 | -101 |
1224+
| -85 | 45 | 8 | -43 | -34 | 83 | -85 | 3 | -72 |
1225+
| -85 | 65 | 17 | -25 | -18 | 83 | -101 | 5 | -101 |
12261226
| -85 | 83 | 5 | -25 | -25 | 83 | -85 | 2 | -48 |
12271227
+-------------+----------+-----------------+---------------+--------+-----+------+----+------+
12281228
"

datafusion/sqllogictest/test_files/aggregate.slt

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1351,7 +1351,7 @@ DROP TABLE median_window_test;
13511351
query RT
13521352
select approx_median(arrow_cast(col_f32, 'Float16')), arrow_typeof(approx_median(arrow_cast(col_f32, 'Float16'))) from median_table;
13531353
----
1354-
2.75 Float16
1354+
2.1992188 Float16
13551355

13561356
# This shouldn't be NaN, see:
13571357
# https://github.com/apache/datafusion/issues/18945
@@ -1369,7 +1369,7 @@ select
13691369
arrow_typeof(approx_percentile_cont(0.5) within group (order by arrow_cast(col_f32, 'Float16')))
13701370
from median_table;
13711371
----
1372-
2.75 Float16
1372+
2.1992188 Float16
13731373

13741374
query ?T
13751375
select approx_median(NULL), arrow_typeof(approx_median(NULL)) from median_table;
@@ -1388,7 +1388,7 @@ select median(c), arrow_typeof(median(c)) from t;
13881388
query RT
13891389
select approx_median(c), arrow_typeof(approx_median(c)) from t;
13901390
----
1391-
0.00035 Float64
1391+
0.0003 Float64
13921392

13931393
statement ok
13941394
drop table t;
@@ -2319,33 +2319,33 @@ b NULL NULL 7732.315789473684
23192319
query TI
23202320
SELECT c1, approx_percentile_cont(0.95) WITHIN GROUP (ORDER BY c3) AS c3_p95 FROM aggregate_test_100 GROUP BY 1 ORDER BY 1
23212321
----
2322-
a 73
2322+
a 65
23232323
b 68
2324-
c 122
2325-
d 124
2326-
e 115
2324+
c 118
2325+
d 125
2326+
e 112
23272327

23282328

23292329
# csv_query_approx_percentile_cont_with_weight (should be the same as above)
23302330
query TI
23312331
SELECT c1, approx_percentile_cont(c3, 0.95) AS c3_p95 FROM aggregate_test_100 GROUP BY 1 ORDER BY 1
23322332
----
2333-
a 73
2333+
a 65
23342334
b 68
2335-
c 122
2336-
d 124
2337-
e 115
2335+
c 118
2336+
d 125
2337+
e 112
23382338

23392339

23402340
# using approx_percentile_cont on 2 columns with same signature
23412341
query TII
23422342
SELECT c1, approx_percentile_cont(c2, 0.95) AS c2, approx_percentile_cont(c3, 0.95) AS c3 FROM aggregate_test_100 GROUP BY 1 ORDER BY 1
23432343
----
2344-
a 5 73
2344+
a 5 65
23452345
b 5 68
2346-
c 5 122
2347-
d 5 124
2348-
e 5 115
2346+
c 5 118
2347+
d 5 125
2348+
e 5 112
23492349

23502350
# error is unique to this UDAF
23512351
query TRR
@@ -2363,50 +2363,50 @@ query TI
23632363
SELECT c1, approx_percentile_cont(0.95) WITHIN GROUP (ORDER BY c3 DESC) AS c3_p95 FROM aggregate_test_100 GROUP BY 1 ORDER BY 1
23642364
----
23652365
a -101
2366-
b -114
2367-
c -109
2368-
d -98
2369-
e -93
2366+
b -117
2367+
c -107
2368+
d -99
2369+
e -86
23702370

23712371
# csv_query_approx_percentile_cont_with_weight (2)
23722372
query TI
23732373
SELECT c1, approx_percentile_cont_with_weight(1, 0.95) WITHIN GROUP (ORDER BY c3) AS c3_p95 FROM aggregate_test_100 GROUP BY 1 ORDER BY 1
23742374
----
2375-
a 73
2375+
a 65
23762376
b 68
2377-
c 122
2378-
d 124
2379-
e 115
2377+
c 118
2378+
d 125
2379+
e 112
23802380

23812381
# csv_query_approx_percentile_cont_with_weight alternate syntax
23822382
query TI
23832383
SELECT c1, approx_percentile_cont_with_weight(c3, 1, 0.95) AS c3_p95 FROM aggregate_test_100 GROUP BY 1 ORDER BY 1
23842384
----
2385-
a 73
2385+
a 65
23862386
b 68
2387-
c 122
2388-
d 124
2389-
e 115
2387+
c 118
2388+
d 125
2389+
e 112
23902390

23912391

23922392
query TI
23932393
SELECT c1, approx_percentile_cont_with_weight(1, 0.95) WITHIN GROUP (ORDER BY c3 DESC) AS c3_p95 FROM aggregate_test_100 GROUP BY 1 ORDER BY 1
23942394
----
23952395
a -101
2396-
b -114
2397-
c -109
2398-
d -98
2399-
e -93
2396+
b -117
2397+
c -107
2398+
d -99
2399+
e -86
24002400

24012401
# csv_query_approx_percentile_cont_with_histogram_bins
24022402
query TI
24032403
SELECT c1, approx_percentile_cont(0.95, 200) WITHIN GROUP (ORDER BY c3) AS c3_p95 FROM aggregate_test_100 GROUP BY 1 ORDER BY 1
24042404
----
2405-
a 73
2405+
a 65
24062406
b 68
2407-
c 122
2408-
d 124
2409-
e 115
2407+
c 118
2408+
d 125
2409+
e 112
24102410

24112411
query TI
24122412
SELECT c1, approx_percentile_cont_with_weight(c2, 0.95) WITHIN GROUP (ORDER BY c3) AS c3_p95 FROM aggregate_test_100 GROUP BY 1 ORDER BY 1

datafusion/sqllogictest/test_files/aggregate_skip_partial.slt

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -321,11 +321,11 @@ SELECT c2, median(c5), median(c11) FROM aggregate_test_100 GROUP BY c2 ORDER BY
321321
query IIR
322322
SELECT c2, approx_median(c5), approx_median(c11) FROM aggregate_test_100 GROUP BY c2 ORDER BY c2;
323323
----
324-
1 191655437 0.59926736
325-
2 -587831330 0.43230486
324+
1 -335410409 0.5780736
325+
2 -587831330 0.4279275
326326
3 240273900 0.40199697
327327
4 762932956 0.48515016
328-
5 593204320 0.5156586
328+
5 586844478 0.44318348
329329

330330
# Test approx_distinct for varchar / int
331331
query III
@@ -405,8 +405,8 @@ SELECT c2, approx_median(c3), approx_median(c11) FROM aggregate_test_100_null GR
405405
1 12 0.6067944
406406
2 1 0.46076488
407407
3 14 0.40154034
408-
4 -7 0.48515016
409-
5 -39 0.5536642
408+
4 -38 0.48515016
409+
5 -40 0.5536642
410410

411411
# Test approx_distinct with nullable fields
412412
query II
@@ -526,7 +526,7 @@ FROM aggregate_test_100 GROUP BY c2 ORDER BY c2;
526526
1 57 -56
527527
2 52 -60
528528
3 71 -76
529-
4 65 -64
529+
4 65 -79
530530
5 64 -59
531531

532532
# Test count with nullable fields and filter
@@ -669,22 +669,22 @@ SELECT c2,
669669
FROM aggregate_test_100_null GROUP BY c2 ORDER BY c2;
670670
----
671671
1 -5 0.6623719
672-
2 12 0.52930677
672+
2 1 0.52930677
673673
3 13 0.32792538
674674
4 -38 0.49774808
675-
5 -21 0.47652745
675+
5 -31 0.44318348
676676

677677
# Test approx_median with nullable fields and nullable filter
678678
query II
679679
SELECT c2,
680680
approx_median(c3) FILTER (WHERE c11 > 0.5)
681681
FROM aggregate_test_100_null GROUP BY c2 ORDER BY c2;
682682
----
683-
1 35
683+
1 29
684684
2 -29
685685
3 22
686686
4 -90
687-
5 -32
687+
5 -40
688688

689689
statement ok
690690
DROP TABLE aggregate_test_100_null;

datafusion/sqllogictest/test_files/metadata.slt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ select count(distinct name) from table_with_metadata;
8686
query I
8787
select approx_median(distinct id) from table_with_metadata;
8888
----
89-
2
89+
1
9090

9191
# Regression test: prevent field metadata loss per https://github.com/apache/datafusion/issues/12687
9292
statement ok

0 commit comments

Comments
 (0)