Skip to content

Commit e83292b

Browse files
authored
Merge branch 'main' into feat_migrate_ffi_to_stabby
2 parents 3628fd2 + 067ba4b commit e83292b

2 files changed

Lines changed: 68 additions & 5 deletions

File tree

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
18+
#############
19+
## ListView Aggregation Tests
20+
#############
21+
22+
### Setup: Create test tables with ListView arrays
23+
24+
statement ok
25+
CREATE TABLE list_view_agg_test AS
26+
SELECT
27+
id,
28+
group_col,
29+
arrow_cast(make_array(val1, val2, val3), 'ListView(Int64)') as list_view_col,
30+
arrow_cast(make_array(val1, val2, val3), 'LargeListView(Int64)') as large_list_view_col
31+
FROM (VALUES
32+
(1, 'A', 10, 20, 30),
33+
(2, 'A', 40, 50, 60),
34+
(3, 'B', 70, 80, 90),
35+
(4, 'B', 100, 110, 120),
36+
(5, 'C', 1, 2, 3)
37+
) AS t(id, group_col, val1, val2, val3);
38+
39+
### Test: GROUP BY on ListView column
40+
41+
query ?I rowsort
42+
SELECT list_view_col, COUNT(*)
43+
FROM list_view_agg_test
44+
GROUP BY list_view_col;
45+
----
46+
[1, 2, 3] 1
47+
[10, 20, 30] 1
48+
[100, 110, 120] 1
49+
[40, 50, 60] 1
50+
[70, 80, 90] 1
51+
52+
query ?I rowsort
53+
SELECT large_list_view_col, COUNT(*)
54+
FROM list_view_agg_test
55+
GROUP BY large_list_view_col;
56+
----
57+
[1, 2, 3] 1
58+
[10, 20, 30] 1
59+
[100, 110, 120] 1
60+
[40, 50, 60] 1
61+
[70, 80, 90] 1
62+
63+
### Cleanup
64+
65+
statement ok
66+
DROP TABLE list_view_agg_test;

datafusion/sqllogictest/test_files/spark/datetime/add_months.slt

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,8 @@ SELECT add_months('2016-07-30'::date, 10000::int);
3131
2849-11-30
3232

3333
# Test integer overflow
34-
# TODO: Enable with next arrow upgrade (>=58.0.0)
35-
# query D
36-
# SELECT add_months('2016-07-30'::date, 2147483647::int);
37-
# ----
38-
# NULL
34+
query error DataFusion error: Arrow error: Compute error: Date arithmetic overflow: 17012 \+ 2147483647 months
35+
SELECT add_months('2016-07-30'::date, 2147483647::int);
3936

4037
query D
4138
SELECT add_months('2016-07-30'::date, -5::int);

0 commit comments

Comments
 (0)