Skip to content

Commit ccfed93

Browse files
add largelist for slt
1 parent 86ccb87 commit ccfed93

File tree

2 files changed

+16
-27
lines changed

2 files changed

+16
-27
lines changed

datafusion/physical-expr/src/array_expressions.rs

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -3094,31 +3094,4 @@ mod tests {
30943094

30953095
make_array(&[arr1, arr2]).expect("failed to initialize function array")
30963096
}
3097-
3098-
#[test]
3099-
fn test_array_distinct() {
3100-
// test: from array [[1, 3, 2, 3, 1, 2, 4], [1, 1]] to [[1, 2, 3, 4], [1]]
3101-
let data = vec![
3102-
Some(vec![
3103-
Some(1),
3104-
Some(3),
3105-
Some(2),
3106-
Some(3),
3107-
Some(1),
3108-
Some(2),
3109-
Some(4),
3110-
]),
3111-
Some(vec![Some(1), Some(1)]),
3112-
];
3113-
let excepted = vec![
3114-
Some(vec![Some(1), Some(2), Some(3), Some(4)]),
3115-
Some(vec![Some(1)]),
3116-
];
3117-
let input =
3118-
Arc::new(ListArray::from_iter_primitive::<Int64Type, _, _>(data)) as ArrayRef;
3119-
let excepted = ListArray::from_iter_primitive::<Int64Type, _, _>(excepted);
3120-
let result = array_distinct(&[input]).unwrap();
3121-
let result = as_list_array(&result).unwrap();
3122-
assert_eq!(result, &excepted);
3123-
}
31243097
}

datafusion/sqllogictest/test_files/array.slt

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,14 @@ AS VALUES
206206
(make_array([5,6], [5,6], NULL))
207207
;
208208

209+
statement ok
210+
CREATE TABLE array_distinct_table_1D_large
211+
AS VALUES
212+
(arrow_cast(make_array(1, 1, 2, 2, 3), 'LargeList(Int64)')),
213+
(arrow_cast(make_array(1, 2, 3, 4, 5), 'LargeList(Int64)')),
214+
(arrow_cast(make_array(3, 5, 3, 3, 3), 'LargeList(Int64)'))
215+
;
216+
209217
statement ok
210218
CREATE TABLE array_intersect_table_1D
211219
AS VALUES
@@ -2691,6 +2699,14 @@ from array_distinct_table_2D;
26912699
[[1, 2], [3, 4], [5, 6], [7, 8], [9, 10]]
26922700
[, [5, 6]]
26932701

2702+
query ?
2703+
select array_distinct(column1)
2704+
from array_distinct_table_1D_large;
2705+
----
2706+
[1, 2, 3]
2707+
[1, 2, 3, 4, 5]
2708+
[3, 5]
2709+
26942710
query ???
26952711
select array_intersect(column1, column2),
26962712
array_intersect(column3, column4),

0 commit comments

Comments
 (0)