From dd9913b5a22c0fbb513f1d1eeda6b1abb94e78b9 Mon Sep 17 00:00:00 2001 From: Sean Smith Date: Mon, 16 Dec 2024 12:25:38 -0600 Subject: [PATCH] fixup! initial impl --- .../src/functions/table/builtin/unnest.rs | 2 +- slt/standard/functions/table/unnest_list.slt | 30 ++++++++++++++++++- 2 files changed, 30 insertions(+), 2 deletions(-) diff --git a/crates/rayexec_execution/src/functions/table/builtin/unnest.rs b/crates/rayexec_execution/src/functions/table/builtin/unnest.rs index ffce2d60b..2a8016d9d 100644 --- a/crates/rayexec_execution/src/functions/table/builtin/unnest.rs +++ b/crates/rayexec_execution/src/functions/table/builtin/unnest.rs @@ -51,7 +51,7 @@ impl FunctionInfo for Unnest { impl TableFunction for Unnest { fn planner(&self) -> TableFunctionPlanner { - unimplemented!() + TableFunctionPlanner::InOut(self) } } diff --git a/slt/standard/functions/table/unnest_list.slt b/slt/standard/functions/table/unnest_list.slt index b82296a69..d318fd42f 100644 --- a/slt/standard/functions/table/unnest_list.slt +++ b/slt/standard/functions/table/unnest_list.slt @@ -1,5 +1,33 @@ # UNNEST as a table function operating on lists. +query TT +DESCRIBE SELECT * FROM unnest([3,4,5]) ORDER BY 1; +---- +unnest Int32 + query I -SELECT * FROM unnest([3,4,5]); +SELECT * FROM unnest([3,4,5]) ORDER BY 1; +---- +3 +4 +5 + +query TT +DESCRIBE SELECT * FROM unnest(NULL); +---- +unnest Null + +query ? +SELECT * FROM unnest(NULL); +---- +NULL + +query ? +SELECT * FROM unnest([]); +---- + +# Lateral + +query ?I +SELECT * FROM (VALUES ([1,2,3]), ([8,9])) v(a), unnest(v.a) ORDER BY 2; ----