Skip to content

Commit 8484c96

Browse files
authored
chore: add tests for out of bounds for NullArray (#16802)
* chore: add tests for out of bounds for NullArray * chore: add tests for out of bounds for NullArray
1 parent 8a3ea87 commit 8484c96

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

datafusion/sqllogictest/test_files/array.slt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8065,6 +8065,13 @@ FixedSizeList(Field { name: "item", data_type: Int32, nullable: true, dict_id: 0
80658065
statement error
80668066
create table varying_fixed_size_col_table (a int[3]) as values ([1,2,3]), ([4,5]);
80678067

8068+
# https://github.com/apache/datafusion/issues/16187
8069+
# should be NULL in case of out of bounds for Null Type
8070+
query ?
8071+
select [named_struct('a', 1, 'b', null)][-2];
8072+
----
8073+
NULL
8074+
80688075
### Delete tables
80698076

80708077
statement ok

datafusion/sqllogictest/test_files/map.slt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -833,5 +833,12 @@ select column3[true] from tt;
833833
----
834834
3
835835

836+
# https://github.com/apache/datafusion/issues/16187
837+
# should be NULL in case of out of bounds for Null Type
838+
query ?
839+
select map_values(map([named_struct('a', 1, 'b', null)], [named_struct('a', 1, 'b', null)]))[0] as a;
840+
----
841+
NULL
842+
836843
statement ok
837844
drop table tt;

0 commit comments

Comments
 (0)