@@ -162,7 +162,7 @@ SELECT approx_percentile_cont(c12, 0.95, c5) FROM aggregate_test_100
162162
163163# Not supported over sliding windows
164164query error This feature is not implemented: Aggregate can not be used as a sliding accumulator because `retract_batch` is not implemented
165- SELECT approx_percentile_cont(c3, 0.5) OVER (ROWS BETWEEN 4 PRECEDING AND CURRENT ROW)
165+ SELECT approx_percentile_cont(c3, 0.5) OVER (ROWS BETWEEN 4 PRECEDING AND CURRENT ROW)
166166FROM aggregate_test_100
167167
168168# array agg can use order by
@@ -2194,7 +2194,7 @@ drop table t;
21942194
21952195# test count with largeutf8
21962196statement ok
2197- create table t (c string) as values
2197+ create table t (c string) as values
21982198 (arrow_cast('a', 'LargeUtf8')),
21992199 (arrow_cast('b', 'LargeUtf8')),
22002200 (arrow_cast(null, 'LargeUtf8')),
@@ -3807,6 +3807,52 @@ SELECT MIN(value), MAX(value) FROM timestampmicrosecond
38073807statement ok
38083808DROP TABLE timestampmicrosecond;
38093809
3810+ # min_duration, max_duration
3811+ statement ok
3812+ create table d
3813+ as values
3814+ (arrow_cast(1, 'Duration(Second)'), arrow_cast(2, 'Duration(Millisecond)'), arrow_cast(3, 'Duration(Microsecond)'), arrow_cast(4, 'Duration(Nanosecond)'), 1),
3815+ (arrow_cast(11, 'Duration(Second)'),arrow_cast(22, 'Duration(Millisecond)'), arrow_cast(33, 'Duration(Microsecond)'), arrow_cast(44, 'Duration(Nanosecond)'), 1);
3816+
3817+ query ????
3818+ SELECT min(column1), min(column2), min(column3), min(column4) FROM d;
3819+ ----
3820+ 0 days 0 hours 0 mins 1 secs 0 days 0 hours 0 mins 0.002 secs 0 days 0 hours 0 mins 0.000003 secs 0 days 0 hours 0 mins 0.000000004 secs
3821+
3822+ query ????
3823+ SELECT max(column1), max(column2), max(column3), max(column4) FROM d;
3824+ ----
3825+ 0 days 0 hours 0 mins 11 secs 0 days 0 hours 0 mins 0.022 secs 0 days 0 hours 0 mins 0.000033 secs 0 days 0 hours 0 mins 0.000000044 secs
3826+
3827+ # GROUP BY follows a different code path
3828+ query ????I
3829+ SELECT min(column1), min(column2), min(column3), min(column4), column5 FROM d GROUP BY column5;
3830+ ----
3831+ 0 days 0 hours 0 mins 1 secs 0 days 0 hours 0 mins 0.002 secs 0 days 0 hours 0 mins 0.000003 secs 0 days 0 hours 0 mins 0.000000004 secs 1
3832+
3833+ query ????I
3834+ SELECT max(column1), max(column2), max(column3), max(column4), column5 FROM d GROUP BY column5;
3835+ ----
3836+ 0 days 0 hours 0 mins 11 secs 0 days 0 hours 0 mins 0.022 secs 0 days 0 hours 0 mins 0.000033 secs 0 days 0 hours 0 mins 0.000000044 secs 1
3837+
3838+ statement ok
3839+ INSERT INTO d VALUES
3840+ (arrow_cast(3, 'Duration(Second)'), arrow_cast(1, 'Duration(Millisecond)'), arrow_cast(7, 'Duration(Microsecond)'), arrow_cast(2, 'Duration(Nanosecond)'), 1),
3841+ (arrow_cast(0, 'Duration(Second)'), arrow_cast(9, 'Duration(Millisecond)'), arrow_cast(5, 'Duration(Microsecond)'), arrow_cast(8, 'Duration(Nanosecond)'), 1);
3842+
3843+ query ????I
3844+ SELECT max(column1), max(column2), max(column3), max(column4), column5 FROM d GROUP BY column5 ORDER BY column5;
3845+ ----
3846+ 0 days 0 hours 0 mins 11 secs 0 days 0 hours 0 mins 0.022 secs 0 days 0 hours 0 mins 0.000033 secs 0 days 0 hours 0 mins 0.000000044 secs 1
3847+
3848+ query ????I
3849+ SELECT min(column1), min(column2), min(column3), min(column4), column5 FROM d GROUP BY column5 ORDER BY column5;
3850+ ----
3851+ 0 days 0 hours 0 mins 0 secs 0 days 0 hours 0 mins 0.001 secs 0 days 0 hours 0 mins 0.000003 secs 0 days 0 hours 0 mins 0.000000002 secs 1
3852+
3853+ statement ok
3854+ drop table d;
3855+
38103856# max_bool
38113857statement ok
38123858CREATE TABLE max_bool (value BOOLEAN);
@@ -4647,7 +4693,7 @@ statement ok
46474693create table t (c1 decimal(10, 0), c2 int) as values (null, null), (null, null), (null, null);
46484694
46494695query RTIT
4650- select
4696+ select
46514697 sum(c1), arrow_typeof(sum(c1)),
46524698 sum(c2), arrow_typeof(sum(c2))
46534699from t;
@@ -5299,7 +5345,7 @@ NULL NULL 3 NULL 1 4 0 8 0
52995345
53005346# regr_*() basic tests
53015347query RRIRRRRRR
5302- select
5348+ select
53035349 regr_slope(column2, column1),
53045350 regr_intercept(column2, column1),
53055351 regr_count(column2, column1),
@@ -5314,7 +5360,7 @@ from (values (1,2), (2,4), (3,6));
531453602 0 3 1 2 4 2 8 4
53155361
53165362query RRIRRRRRR
5317- select
5363+ select
53185364 regr_slope(c12, c11),
53195365 regr_intercept(c12, c11),
53205366 regr_count(c12, c11),
@@ -5332,7 +5378,7 @@ from aggregate_test_100;
53325378
53335379# regr_*() functions ignore NULLs
53345380query RRIRRRRRR
5335- select
5381+ select
53365382 regr_slope(column2, column1),
53375383 regr_intercept(column2, column1),
53385384 regr_count(column2, column1),
@@ -5347,7 +5393,7 @@ from (values (1,NULL), (2,4), (3,6));
534753932 0 2 1 2.5 5 0.5 2 1
53485394
53495395query RRIRRRRRR
5350- select
5396+ select
53515397 regr_slope(column2, column1),
53525398 regr_intercept(column2, column1),
53535399 regr_count(column2, column1),
@@ -5362,7 +5408,7 @@ from (values (1,NULL), (NULL,4), (3,6));
53625408NULL NULL 1 NULL 3 6 0 0 0
53635409
53645410query RRIRRRRRR
5365- select
5411+ select
53665412 regr_slope(column2, column1),
53675413 regr_intercept(column2, column1),
53685414 regr_count(column2, column1),
@@ -5377,8 +5423,8 @@ from (values (1,NULL), (NULL,4), (NULL,NULL));
53775423NULL NULL 0 NULL NULL NULL NULL NULL NULL
53785424
53795425query TRRIRRRRRR rowsort
5380- select
5381- column3,
5426+ select
5427+ column3,
53825428 regr_slope(column2, column1),
53835429 regr_intercept(column2, column1),
53845430 regr_count(column2, column1),
@@ -5402,7 +5448,7 @@ statement ok
54025448set datafusion.execution.batch_size = 1;
54035449
54045450query RRIRRRRRR
5405- select
5451+ select
54065452 regr_slope(c12, c11),
54075453 regr_intercept(c12, c11),
54085454 regr_count(c12, c11),
@@ -5420,7 +5466,7 @@ statement ok
54205466set datafusion.execution.batch_size = 2;
54215467
54225468query RRIRRRRRR
5423- select
5469+ select
54245470 regr_slope(c12, c11),
54255471 regr_intercept(c12, c11),
54265472 regr_count(c12, c11),
@@ -5438,7 +5484,7 @@ statement ok
54385484set datafusion.execution.batch_size = 3;
54395485
54405486query RRIRRRRRR
5441- select
5487+ select
54425488 regr_slope(c12, c11),
54435489 regr_intercept(c12, c11),
54445490 regr_count(c12, c11),
@@ -5592,7 +5638,7 @@ CREATE TABLE float_table (
55925638
55935639# Test string_agg with largeutf8
55945640statement ok
5595- create table string_agg_large_utf8 (c string) as values
5641+ create table string_agg_large_utf8 (c string) as values
55965642 (arrow_cast('a', 'LargeUtf8')),
55975643 (arrow_cast('b', 'LargeUtf8')),
55985644 (arrow_cast('c', 'LargeUtf8'))
@@ -5647,7 +5693,7 @@ select count(*) from (select count(*) a, count(*) b from (select 1));
56475693
56485694# UTF8 string matters for string to &[u8] conversion, add it to prevent regression
56495695statement ok
5650- create table distinct_count_string_table as values
5696+ create table distinct_count_string_table as values
56515697 (1, 'a', 'longstringtest_a', '台灣'),
56525698 (2, 'b', 'longstringtest_b1', '日本'),
56535699 (2, 'b', 'longstringtest_b2', '中國'),
@@ -6625,7 +6671,7 @@ group1 0.0003
66256671# median with all nulls
66266672statement ok
66276673create table group_median_all_nulls(
6628- a STRING NOT NULL,
6674+ a STRING NOT NULL,
66296675 b INT
66306676) AS VALUES
66316677( 'group0', NULL),
0 commit comments