Skip to content

Commit

Permalink
Minor: consolidate map sqllogictest tests (#8550)
Browse files Browse the repository at this point in the history
* Minor: consolidate map sqllogictest tests

* add plan
  • Loading branch information
alamb authored Dec 20, 2023
1 parent 448e413 commit 778779f
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 5 deletions.
2 changes: 1 addition & 1 deletion datafusion/sqllogictest/src/test_context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ impl TestContext {
info!("Registering table with many types");
register_table_with_many_types(test_ctx.session_ctx()).await;
}
"explain.slt" => {
"map.slt" => {
info!("Registering table with map");
register_table_with_map(test_ctx.session_ctx()).await;
}
Expand Down
4 changes: 0 additions & 4 deletions datafusion/sqllogictest/test_files/explain.slt
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,3 @@ Projection: List([[1, 2, 3], [4, 5, 6]]) AS make_array(make_array(Int64(1),Int64
physical_plan
ProjectionExec: expr=[[[1, 2, 3], [4, 5, 6]] as make_array(make_array(Int64(1),Int64(2),Int64(3)),make_array(Int64(4),Int64(5),Int64(6)))]
--PlaceholderRowExec

# Testing explain on a table with a map filter, registered in test_context.rs.
statement ok
explain select * from table_with_map where int_field > 0
19 changes: 19 additions & 0 deletions datafusion/sqllogictest/test_files/map.slt
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,22 @@ DELETE 24
query T
SELECT strings['not_found'] FROM data LIMIT 1;
----

statement ok
drop table data;


# Testing explain on a table with a map filter, registered in test_context.rs.
query TT
explain select * from table_with_map where int_field > 0;
----
logical_plan
Filter: table_with_map.int_field > Int64(0)
--TableScan: table_with_map projection=[int_field, map_field]
physical_plan
CoalesceBatchesExec: target_batch_size=8192
--FilterExec: int_field@0 > 0
----MemoryExec: partitions=1, partition_sizes=[0]

statement ok
drop table table_with_map;

0 comments on commit 778779f

Please sign in to comment.