You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@arrow.apache.org by al...@apache.org on 2023/12/20 20:49:41 UTC

(arrow-datafusion) branch main updated: Minor: consolidate map sqllogictest tests (#8550)

This is an automated email from the ASF dual-hosted git repository.

alamb pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow-datafusion.git


The following commit(s) were added to refs/heads/main by this push:
     new 778779f7d7 Minor: consolidate map sqllogictest tests (#8550)
778779f7d7 is described below

commit 778779f7d72c45e7583100e5ff25c504cd48042b
Author: Andrew Lamb <an...@nerdnetworks.org>
AuthorDate: Wed Dec 20 15:49:36 2023 -0500

    Minor: consolidate map sqllogictest tests (#8550)
    
    * Minor: consolidate map sqllogictest tests
    
    * add plan
---
 datafusion/sqllogictest/src/test_context.rs    |  2 +-
 datafusion/sqllogictest/test_files/explain.slt |  4 ----
 datafusion/sqllogictest/test_files/map.slt     | 19 +++++++++++++++++++
 3 files changed, 20 insertions(+), 5 deletions(-)

diff --git a/datafusion/sqllogictest/src/test_context.rs b/datafusion/sqllogictest/src/test_context.rs
index 91093510af..941dcb69d2 100644
--- a/datafusion/sqllogictest/src/test_context.rs
+++ b/datafusion/sqllogictest/src/test_context.rs
@@ -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;
             }
diff --git a/datafusion/sqllogictest/test_files/explain.slt b/datafusion/sqllogictest/test_files/explain.slt
index a51c3aed13..4583ef319b 100644
--- a/datafusion/sqllogictest/test_files/explain.slt
+++ b/datafusion/sqllogictest/test_files/explain.slt
@@ -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
diff --git a/datafusion/sqllogictest/test_files/map.slt b/datafusion/sqllogictest/test_files/map.slt
index c3d16fca90..7863bf4454 100644
--- a/datafusion/sqllogictest/test_files/map.slt
+++ b/datafusion/sqllogictest/test_files/map.slt
@@ -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;