Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
84 changes: 26 additions & 58 deletions datafusion/core/tests/sqllogictests/test_files/aggregate.slt
Original file line number Diff line number Diff line change
Expand Up @@ -1013,9 +1013,9 @@ select c2, sum(c3) sum_c3, avg(c3) avg_c3, max(c3) max_c3, min(c3) min_c3, count
4 29 1.260869565217 123 -117 23
5 -194 -13.857142857143 118 -101 14

# TODO: csv_query_array_agg_unsupported
# statement error
# SELECT array_agg(c13 ORDER BY c1) FROM aggregate_test_100;
# csv_query_array_agg_unsupported
statement error This feature is not implemented: ORDER BY not supported in ARRAY_AGG: c1
SELECT array_agg(c13 ORDER BY c1) FROM aggregate_test_100;

# csv_query_array_cube_agg_with_overflow
query TIIRIII
Expand Down Expand Up @@ -1058,73 +1058,44 @@ NULL 4 29 1.260869565217 123 -117 23
NULL 5 -194 -13.857142857143 118 -101 14
NULL NULL 781 7.81 125 -117 100

# TODO this querys output is non determinisitic (the order of the elements
# differs run to run
#
# csv_query_array_agg_distinct
# query T
# SELECT array_agg(distinct c2) FROM aggregate_test_100
# ----
# [4, 2, 3, 5, 1]

# TODO: aggregate_timestamps_sum
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These tests are added in #5574


# aggregate_timestamps_count
# query IIII
# SELECT count(nanos), count(micros), count(millis), count(secs) FROM t
# ----
# 3 3 3 3

# aggregate_timestamps_min
# query TTTT
# SELECT min(nanos), min(micros), min(millis), min(secs) FROM t
# ----
# 2011-12-13T11:13:10.123450 2011-12-13T11:13:10.123450 2011-12-13T11:13:10.123 2011-12-13T11:13:10

# # aggregate_timestamps_max
# query TTTT
# SELECT max(nanos), max(micros), max(millis), max(secs) FROM t
# ----
# 2021-01-01T05:11:10.432 2021-01-01T05:11:10.432 2021-01-01T05:11:10.432 2021-01-01T05:11:10

# TODO: aggregate_times_sum

# TODO: aggregate_times_count

# TODO: aggregate_times_min

# TODO: aggregate_times_max

# TODO: aggregate_timestamps_avg

# aggregate_time_min_and_max
query TT
select min(t), max(t) from (select '00:00:00' as t union select '00:00:01' union select '00:00:02')
----
00:00:00 00:00:02

# aggregate_decimal_min
query R
select min(c1) from d_table
query RT
select min(c1), arrow_typeof(min(c1)) from d_table
Comment on lines +1077 to +1078
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

----
-100.009
-100.009 Decimal128(10, 3)

# aggregate_decimal_max
query R
select max(c1) from d_table
query RT
select max(c1), arrow_typeof(max(c1)) from d_table
----
110.009
110.009 Decimal128(10, 3)

# FIX: doesn't check datatype
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added type check per comment

# aggregate_decimal_sum
query R
select sum(c1) from d_table
query RT
select sum(c1), arrow_typeof(sum(c1)) from d_table
----
100
100 Decimal128(20, 3)

# FIX: doesn't check datatype
# aggregate_decimal_avg
query R
select avg(c1) from d_table
query RT
select avg(c1), arrow_typeof(avg(c1)) from d_table
----
5
5 Decimal128(14, 7)

# FIX: different test table
# aggregate
Expand Down Expand Up @@ -1191,19 +1162,17 @@ SELECT COUNT(DISTINCT c1) FROM test

# TODO: aggregate_with_alias

# FIX: CSV Writer error
# array_agg_zero
# query I
# SELECT ARRAY_AGG([])
# ----
# []
query ?
SELECT ARRAY_AGG([])
----
[]

# FIX: CSV Writer error
# array_agg_one
# query I
# SELECT ARRAY_AGG([1])
# ----
# [[1]]
query ?
SELECT ARRAY_AGG([1])
----
[[1]]

# test_approx_percentile_cont_decimal_support
query TI
Expand All @@ -1216,7 +1185,6 @@ d 4
e 4



# array_agg_zero
query ?
SELECT ARRAY_AGG([]);
Expand Down