From 98491abd70af5c5c401161a3914ac674c5278bb9 Mon Sep 17 00:00:00 2001 From: jayzhan211 Date: Fri, 3 May 2024 17:14:58 +0800 Subject: [PATCH 01/11] rename Signed-off-by: jayzhan211 --- datafusion/core/src/physical_planner.rs | 2 +- datafusion/expr/src/expr.rs | 2 +- .../test_files/agg_func_substitute.slt | 26 ++++++++--------- .../sqllogictest/test_files/explain.slt | 12 ++++---- datafusion/sqllogictest/test_files/expr.slt | 10 +++---- .../sqllogictest/test_files/group_by.slt | 22 +++++++-------- datafusion/sqllogictest/test_files/scalar.slt | 6 ++-- datafusion/sqllogictest/test_files/select.slt | 2 +- datafusion/sqllogictest/test_files/struct.slt | 2 +- datafusion/sqllogictest/test_files/window.slt | 28 +++++++++---------- 10 files changed, 56 insertions(+), 56 deletions(-) diff --git a/datafusion/core/src/physical_planner.rs b/datafusion/core/src/physical_planner.rs index d4a9a949fc41..f6485dddce5b 100644 --- a/datafusion/core/src/physical_planner.rs +++ b/datafusion/core/src/physical_planner.rs @@ -121,7 +121,7 @@ fn create_function_physical_name( false => "", }; - let phys_name = format!("{}({}{})", fun, distinct_str, names.join(",")); + let phys_name = format!("{}({}{})", fun, distinct_str, names.join(", ")); Ok(order_by .map(|order_by| format!("{} ORDER BY [{}]", phys_name, expr_vec_fmt!(order_by))) diff --git a/datafusion/expr/src/expr.rs b/datafusion/expr/src/expr.rs index 84e4cb6435a3..6097e201603b 100644 --- a/datafusion/expr/src/expr.rs +++ b/datafusion/expr/src/expr.rs @@ -1656,7 +1656,7 @@ fn create_function_name(fun: &str, distinct: bool, args: &[Expr]) -> Result "DISTINCT ", false => "", }; - Ok(format!("{}({}{})", fun, distinct_str, names.join(","))) + Ok(format!("{}({}{})", fun, distinct_str, names.join(", "))) } /// Returns a readable name of an expression based on the input schema. diff --git a/datafusion/sqllogictest/test_files/agg_func_substitute.slt b/datafusion/sqllogictest/test_files/agg_func_substitute.slt index c5cd78f1259b..61a0777c04bf 100644 --- a/datafusion/sqllogictest/test_files/agg_func_substitute.slt +++ b/datafusion/sqllogictest/test_files/agg_func_substitute.slt @@ -39,16 +39,16 @@ EXPLAIN SELECT a, ARRAY_AGG(c ORDER BY c)[1] as result GROUP BY a; ---- logical_plan -01)Projection: multiple_ordered_table.a, NTH_VALUE(multiple_ordered_table.c,Int64(1)) ORDER BY [multiple_ordered_table.c ASC NULLS LAST] AS result +01)Projection: multiple_ordered_table.a, NTH_VALUE(multiple_ordered_table.c, Int64(1)) ORDER BY [multiple_ordered_table.c ASC NULLS LAST] AS result 02)--Aggregate: groupBy=[[multiple_ordered_table.a]], aggr=[[NTH_VALUE(multiple_ordered_table.c, Int64(1)) ORDER BY [multiple_ordered_table.c ASC NULLS LAST]]] 03)----TableScan: multiple_ordered_table projection=[a, c] physical_plan -01)ProjectionExec: expr=[a@0 as a, NTH_VALUE(multiple_ordered_table.c,Int64(1)) ORDER BY [multiple_ordered_table.c ASC NULLS LAST]@1 as result] -02)--AggregateExec: mode=FinalPartitioned, gby=[a@0 as a], aggr=[NTH_VALUE(multiple_ordered_table.c,Int64(1)) ORDER BY [multiple_ordered_table.c ASC NULLS LAST]], ordering_mode=Sorted +01)ProjectionExec: expr=[a@0 as a, NTH_VALUE(multiple_ordered_table.c, Int64(1)) ORDER BY [multiple_ordered_table.c ASC NULLS LAST]@1 as result] +02)--AggregateExec: mode=FinalPartitioned, gby=[a@0 as a], aggr=[NTH_VALUE(multiple_ordered_table.c, Int64(1)) ORDER BY [multiple_ordered_table.c ASC NULLS LAST]], ordering_mode=Sorted 03)----SortExec: expr=[a@0 ASC NULLS LAST], preserve_partitioning=[true] 04)------CoalesceBatchesExec: target_batch_size=8192 05)--------RepartitionExec: partitioning=Hash([a@0], 4), input_partitions=4 -06)----------AggregateExec: mode=Partial, gby=[a@0 as a], aggr=[NTH_VALUE(multiple_ordered_table.c,Int64(1)) ORDER BY [multiple_ordered_table.c ASC NULLS LAST]], ordering_mode=Sorted +06)----------AggregateExec: mode=Partial, gby=[a@0 as a], aggr=[NTH_VALUE(multiple_ordered_table.c, Int64(1)) ORDER BY [multiple_ordered_table.c ASC NULLS LAST]], ordering_mode=Sorted 07)------------RepartitionExec: partitioning=RoundRobinBatch(4), input_partitions=1 08)--------------CsvExec: file_groups={1 group: [[WORKSPACE_ROOT/datafusion/core/tests/data/window_2.csv]]}, projection=[a, c], output_orderings=[[a@0 ASC NULLS LAST], [c@1 ASC NULLS LAST]], has_header=true @@ -59,16 +59,16 @@ EXPLAIN SELECT a, NTH_VALUE(c, 1 ORDER BY c) as result GROUP BY a; ---- logical_plan -01)Projection: multiple_ordered_table.a, NTH_VALUE(multiple_ordered_table.c,Int64(1)) ORDER BY [multiple_ordered_table.c ASC NULLS LAST] AS result +01)Projection: multiple_ordered_table.a, NTH_VALUE(multiple_ordered_table.c, Int64(1)) ORDER BY [multiple_ordered_table.c ASC NULLS LAST] AS result 02)--Aggregate: groupBy=[[multiple_ordered_table.a]], aggr=[[NTH_VALUE(multiple_ordered_table.c, Int64(1)) ORDER BY [multiple_ordered_table.c ASC NULLS LAST]]] 03)----TableScan: multiple_ordered_table projection=[a, c] physical_plan -01)ProjectionExec: expr=[a@0 as a, NTH_VALUE(multiple_ordered_table.c,Int64(1)) ORDER BY [multiple_ordered_table.c ASC NULLS LAST]@1 as result] -02)--AggregateExec: mode=FinalPartitioned, gby=[a@0 as a], aggr=[NTH_VALUE(multiple_ordered_table.c,Int64(1)) ORDER BY [multiple_ordered_table.c ASC NULLS LAST]], ordering_mode=Sorted +01)ProjectionExec: expr=[a@0 as a, NTH_VALUE(multiple_ordered_table.c, Int64(1)) ORDER BY [multiple_ordered_table.c ASC NULLS LAST]@1 as result] +02)--AggregateExec: mode=FinalPartitioned, gby=[a@0 as a], aggr=[NTH_VALUE(multiple_ordered_table.c, Int64(1)) ORDER BY [multiple_ordered_table.c ASC NULLS LAST]], ordering_mode=Sorted 03)----SortExec: expr=[a@0 ASC NULLS LAST], preserve_partitioning=[true] 04)------CoalesceBatchesExec: target_batch_size=8192 05)--------RepartitionExec: partitioning=Hash([a@0], 4), input_partitions=4 -06)----------AggregateExec: mode=Partial, gby=[a@0 as a], aggr=[NTH_VALUE(multiple_ordered_table.c,Int64(1)) ORDER BY [multiple_ordered_table.c ASC NULLS LAST]], ordering_mode=Sorted +06)----------AggregateExec: mode=Partial, gby=[a@0 as a], aggr=[NTH_VALUE(multiple_ordered_table.c, Int64(1)) ORDER BY [multiple_ordered_table.c ASC NULLS LAST]], ordering_mode=Sorted 07)------------RepartitionExec: partitioning=RoundRobinBatch(4), input_partitions=1 08)--------------CsvExec: file_groups={1 group: [[WORKSPACE_ROOT/datafusion/core/tests/data/window_2.csv]]}, projection=[a, c], output_orderings=[[a@0 ASC NULLS LAST], [c@1 ASC NULLS LAST]], has_header=true @@ -78,16 +78,16 @@ EXPLAIN SELECT a, ARRAY_AGG(c ORDER BY c)[1 + 100] as result GROUP BY a; ---- logical_plan -01)Projection: multiple_ordered_table.a, NTH_VALUE(multiple_ordered_table.c,Int64(1) + Int64(100)) ORDER BY [multiple_ordered_table.c ASC NULLS LAST] AS result -02)--Aggregate: groupBy=[[multiple_ordered_table.a]], aggr=[[NTH_VALUE(multiple_ordered_table.c, Int64(101)) ORDER BY [multiple_ordered_table.c ASC NULLS LAST] AS NTH_VALUE(multiple_ordered_table.c,Int64(1) + Int64(100)) ORDER BY [multiple_ordered_table.c ASC NULLS LAST]]] +01)Projection: multiple_ordered_table.a, NTH_VALUE(multiple_ordered_table.c, Int64(1) + Int64(100)) ORDER BY [multiple_ordered_table.c ASC NULLS LAST] AS result +02)--Aggregate: groupBy=[[multiple_ordered_table.a]], aggr=[[NTH_VALUE(multiple_ordered_table.c, Int64(101)) ORDER BY [multiple_ordered_table.c ASC NULLS LAST] AS NTH_VALUE(multiple_ordered_table.c, Int64(1) + Int64(100)) ORDER BY [multiple_ordered_table.c ASC NULLS LAST]]] 03)----TableScan: multiple_ordered_table projection=[a, c] physical_plan -01)ProjectionExec: expr=[a@0 as a, NTH_VALUE(multiple_ordered_table.c,Int64(1) + Int64(100)) ORDER BY [multiple_ordered_table.c ASC NULLS LAST]@1 as result] -02)--AggregateExec: mode=FinalPartitioned, gby=[a@0 as a], aggr=[NTH_VALUE(multiple_ordered_table.c,Int64(1) + Int64(100)) ORDER BY [multiple_ordered_table.c ASC NULLS LAST]], ordering_mode=Sorted +01)ProjectionExec: expr=[a@0 as a, NTH_VALUE(multiple_ordered_table.c, Int64(1) + Int64(100)) ORDER BY [multiple_ordered_table.c ASC NULLS LAST]@1 as result] +02)--AggregateExec: mode=FinalPartitioned, gby=[a@0 as a], aggr=[NTH_VALUE(multiple_ordered_table.c, Int64(1) + Int64(100)) ORDER BY [multiple_ordered_table.c ASC NULLS LAST]], ordering_mode=Sorted 03)----SortExec: expr=[a@0 ASC NULLS LAST], preserve_partitioning=[true] 04)------CoalesceBatchesExec: target_batch_size=8192 05)--------RepartitionExec: partitioning=Hash([a@0], 4), input_partitions=4 -06)----------AggregateExec: mode=Partial, gby=[a@0 as a], aggr=[NTH_VALUE(multiple_ordered_table.c,Int64(1) + Int64(100)) ORDER BY [multiple_ordered_table.c ASC NULLS LAST]], ordering_mode=Sorted +06)----------AggregateExec: mode=Partial, gby=[a@0 as a], aggr=[NTH_VALUE(multiple_ordered_table.c, Int64(1) + Int64(100)) ORDER BY [multiple_ordered_table.c ASC NULLS LAST]], ordering_mode=Sorted 07)------------RepartitionExec: partitioning=RoundRobinBatch(4), input_partitions=1 08)--------------CsvExec: file_groups={1 group: [[WORKSPACE_ROOT/datafusion/core/tests/data/window_2.csv]]}, projection=[a, c], output_orderings=[[a@0 ASC NULLS LAST], [c@1 ASC NULLS LAST]], has_header=true diff --git a/datafusion/sqllogictest/test_files/explain.slt b/datafusion/sqllogictest/test_files/explain.slt index 205306882b4a..538babbdbe82 100644 --- a/datafusion/sqllogictest/test_files/explain.slt +++ b/datafusion/sqllogictest/test_files/explain.slt @@ -371,20 +371,20 @@ query TT explain select make_array(make_array(1, 2, 3), make_array(4, 5, 6)); ---- logical_plan -01)Projection: List([[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))) +01)Projection: List([[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))) 02)--EmptyRelation physical_plan -01)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)))] +01)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)))] 02)--PlaceholderRowExec query TT explain select [[1, 2, 3], [4, 5, 6]]; ---- logical_plan -01)Projection: List([[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))) +01)Projection: List([[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))) 02)--EmptyRelation physical_plan -01)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)))] +01)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)))] 02)--PlaceholderRowExec # Explain Struct @@ -393,8 +393,8 @@ query TT explain select struct(1, 2.3, 'abc'); ---- logical_plan -01)Projection: Struct({c0:1,c1:2.3,c2:abc}) AS struct(Int64(1),Float64(2.3),Utf8("abc")) +01)Projection: Struct({c0:1,c1:2.3,c2:abc}) AS struct(Int64(1), Float64(2.3), Utf8("abc")) 02)--EmptyRelation physical_plan -01)ProjectionExec: expr=[{c0:1,c1:2.3,c2:abc} as struct(Int64(1),Float64(2.3),Utf8("abc"))] +01)ProjectionExec: expr=[{c0:1,c1:2.3,c2:abc} as struct(Int64(1), Float64(2.3), Utf8("abc"))] 02)--PlaceholderRowExec diff --git a/datafusion/sqllogictest/test_files/expr.slt b/datafusion/sqllogictest/test_files/expr.slt index 129a67208354..28f4de0d0753 100644 --- a/datafusion/sqllogictest/test_files/expr.slt +++ b/datafusion/sqllogictest/test_files/expr.slt @@ -2316,7 +2316,7 @@ select struct(time,load1,load2,host) from t1; # can have an aggregate function with an inner coalesce query TR -select t2."struct(t1.time,t1.load1,t1.load2,t1.host)"['c3'] as host, sum(coalesce(t2."struct(t1.time,t1.load1,t1.load2,t1.host)")['c1']) from (select struct(time,load1,load2,host) from t1) t2 where t2."struct(t1.time,t1.load1,t1.load2,t1.host)"['c3'] IS NOT NULL group by t2."struct(t1.time,t1.load1,t1.load2,t1.host)"['c3'] order by host; +select t2."struct(t1.time, t1.load1, t1.load2, t1.host)"['c3'] as host, sum(coalesce(t2."struct(t1.time, t1.load1, t1.load2, t1.host)")['c1']) from (select struct(time,load1,load2,host) from t1) t2 where t2."struct(t1.time, t1.load1, t1.load2, t1.host)"['c3'] IS NOT NULL group by t2."struct(t1.time, t1.load1, t1.load2, t1.host)"['c3'] order by host; ---- host1 1.1 host2 2.2 @@ -2324,7 +2324,7 @@ host3 3.3 # can have an aggregate function with an inner CASE WHEN query TR -select t2."struct(t1.time,t1.load1,t1.load2,t1.host)"['c3'] as host, sum((case when t2."struct(t1.time,t1.load1,t1.load2,t1.host)"['c3'] is not null then t2."struct(t1.time,t1.load1,t1.load2,t1.host)" end)['c2']) from (select struct(time,load1,load2,host) from t1) t2 where t2."struct(t1.time,t1.load1,t1.load2,t1.host)"['c3'] IS NOT NULL group by t2."struct(t1.time,t1.load1,t1.load2,t1.host)"['c3'] order by host; +select t2."struct(t1.time, t1.load1, t1.load2, t1.host)"['c3'] as host, sum((case when t2."struct(t1.time, t1.load1, t1.load2, t1.host)"['c3'] is not null then t2."struct(t1.time, t1.load1, t1.load2, t1.host)" end)['c2']) from (select struct(time,load1,load2,host) from t1) t2 where t2."struct(t1.time, t1.load1, t1.load2, t1.host)"['c3'] IS NOT NULL group by t2."struct(t1.time, t1.load1, t1.load2, t1.host)"['c3'] order by host; ---- host1 101 host2 202 @@ -2332,7 +2332,7 @@ host3 303 # can have 2 projections with aggr(short_circuited), with different short-circuited expr query TRR -select t2."struct(t1.time,t1.load1,t1.load2,t1.host)"['c3'] as host, sum(coalesce(t2."struct(t1.time,t1.load1,t1.load2,t1.host)")['c1']), sum((case when t2."struct(t1.time,t1.load1,t1.load2,t1.host)"['c3'] is not null then t2."struct(t1.time,t1.load1,t1.load2,t1.host)" end)['c2']) from (select struct(time,load1,load2,host) from t1) t2 where t2."struct(t1.time,t1.load1,t1.load2,t1.host)"['c3'] IS NOT NULL group by t2."struct(t1.time,t1.load1,t1.load2,t1.host)"['c3'] order by host; +select t2."struct(t1.time, t1.load1, t1.load2, t1.host)"['c3'] as host, sum(coalesce(t2."struct(t1.time, t1.load1, t1.load2, t1.host)")['c1']), sum((case when t2."struct(t1.time, t1.load1, t1.load2, t1.host)"['c3'] is not null then t2."struct(t1.time, t1.load1, t1.load2, t1.host)" end)['c2']) from (select struct(time,load1,load2,host) from t1) t2 where t2."struct(t1.time, t1.load1, t1.load2, t1.host)"['c3'] IS NOT NULL group by t2."struct(t1.time, t1.load1, t1.load2, t1.host)"['c3'] order by host; ---- host1 1.1 101 host2 2.2 202 @@ -2340,7 +2340,7 @@ host3 3.3 303 # can have 2 projections with aggr(short_circuited), with the same short-circuited expr (e.g. CASE WHEN) query TRR -select t2."struct(t1.time,t1.load1,t1.load2,t1.host)"['c3'] as host, sum((case when t2."struct(t1.time,t1.load1,t1.load2,t1.host)"['c3'] is not null then t2."struct(t1.time,t1.load1,t1.load2,t1.host)" end)['c1']), sum((case when t2."struct(t1.time,t1.load1,t1.load2,t1.host)"['c3'] is not null then t2."struct(t1.time,t1.load1,t1.load2,t1.host)" end)['c2']) from (select struct(time,load1,load2,host) from t1) t2 where t2."struct(t1.time,t1.load1,t1.load2,t1.host)"['c3'] IS NOT NULL group by t2."struct(t1.time,t1.load1,t1.load2,t1.host)"['c3'] order by host; +select t2."struct(t1.time, t1.load1, t1.load2, t1.host)"['c3'] as host, sum((case when t2."struct(t1.time, t1.load1, t1.load2, t1.host)"['c3'] is not null then t2."struct(t1.time, t1.load1, t1.load2, t1.host)" end)['c1']), sum((case when t2."struct(t1.time, t1.load1, t1.load2, t1.host)"['c3'] is not null then t2."struct(t1.time, t1.load1, t1.load2, t1.host)" end)['c2']) from (select struct(time,load1,load2,host) from t1) t2 where t2."struct(t1.time, t1.load1, t1.load2, t1.host)"['c3'] IS NOT NULL group by t2."struct(t1.time, t1.load1, t1.load2, t1.host)"['c3'] order by host; ---- host1 1.1 101 host2 2.2 202 @@ -2348,7 +2348,7 @@ host3 3.3 303 # can have 2 projections with aggr(short_circuited), with the same short-circuited expr (e.g. coalesce) query TRR -select t2."struct(t1.time,t1.load1,t1.load2,t1.host)"['c3'] as host, sum(coalesce(t2."struct(t1.time,t1.load1,t1.load2,t1.host)")['c1']), sum(coalesce(t2."struct(t1.time,t1.load1,t1.load2,t1.host)")['c2']) from (select struct(time,load1,load2,host) from t1) t2 where t2."struct(t1.time,t1.load1,t1.load2,t1.host)"['c3'] IS NOT NULL group by t2."struct(t1.time,t1.load1,t1.load2,t1.host)"['c3'] order by host; +select t2."struct(t1.time, t1.load1, t1.load2, t1.host)"['c3'] as host, sum(coalesce(t2."struct(t1.time, t1.load1, t1.load2, t1.host)")['c1']), sum(coalesce(t2."struct(t1.time, t1.load1, t1.load2, t1.host)")['c2']) from (select struct(time,load1,load2,host) from t1) t2 where t2."struct(t1.time, t1.load1, t1.load2, t1.host)"['c3'] IS NOT NULL group by t2."struct(t1.time, t1.load1, t1.load2, t1.host)"['c3'] order by host; ---- host1 1.1 101 host2 2.2 202 diff --git a/datafusion/sqllogictest/test_files/group_by.slt b/datafusion/sqllogictest/test_files/group_by.slt index 5a605ea58b6c..f8b86be8f10a 100644 --- a/datafusion/sqllogictest/test_files/group_by.slt +++ b/datafusion/sqllogictest/test_files/group_by.slt @@ -4225,17 +4225,17 @@ EXPLAIN SELECT date_bin('15 minutes', ts) as time_chunks logical_plan 01)Limit: skip=0, fetch=5 02)--Sort: time_chunks DESC NULLS FIRST, fetch=5 -03)----Projection: date_bin(Utf8("15 minutes"),unbounded_csv_with_timestamps.ts) AS time_chunks -04)------Aggregate: groupBy=[[date_bin(IntervalMonthDayNano("900000000000"), unbounded_csv_with_timestamps.ts) AS date_bin(Utf8("15 minutes"),unbounded_csv_with_timestamps.ts)]], aggr=[[]] +03)----Projection: date_bin(Utf8("15 minutes"), unbounded_csv_with_timestamps.ts) AS time_chunks +04)------Aggregate: groupBy=[[date_bin(IntervalMonthDayNano("900000000000"), unbounded_csv_with_timestamps.ts) AS date_bin(Utf8("15 minutes"), unbounded_csv_with_timestamps.ts)]], aggr=[[]] 05)--------TableScan: unbounded_csv_with_timestamps projection=[ts] physical_plan 01)GlobalLimitExec: skip=0, fetch=5 02)--SortPreservingMergeExec: [time_chunks@0 DESC], fetch=5 -03)----ProjectionExec: expr=[date_bin(Utf8("15 minutes"),unbounded_csv_with_timestamps.ts)@0 as time_chunks] -04)------AggregateExec: mode=FinalPartitioned, gby=[date_bin(Utf8("15 minutes"),unbounded_csv_with_timestamps.ts)@0 as date_bin(Utf8("15 minutes"),unbounded_csv_with_timestamps.ts)], aggr=[], ordering_mode=Sorted +03)----ProjectionExec: expr=[date_bin(Utf8("15 minutes"), unbounded_csv_with_timestamps.ts)@0 as time_chunks] +04)------AggregateExec: mode=FinalPartitioned, gby=[date_bin(Utf8("15 minutes"), unbounded_csv_with_timestamps.ts)@0 as date_bin(Utf8("15 minutes"), unbounded_csv_with_timestamps.ts)], aggr=[], ordering_mode=Sorted 05)--------CoalesceBatchesExec: target_batch_size=2 -06)----------RepartitionExec: partitioning=Hash([date_bin(Utf8("15 minutes"),unbounded_csv_with_timestamps.ts)@0], 8), input_partitions=8, preserve_order=true, sort_exprs=date_bin(Utf8("15 minutes"),unbounded_csv_with_timestamps.ts)@0 DESC -07)------------AggregateExec: mode=Partial, gby=[date_bin(900000000000, ts@0) as date_bin(Utf8("15 minutes"),unbounded_csv_with_timestamps.ts)], aggr=[], ordering_mode=Sorted +06)----------RepartitionExec: partitioning=Hash([date_bin(Utf8("15 minutes"), unbounded_csv_with_timestamps.ts)@0], 8), input_partitions=8, preserve_order=true, sort_exprs=date_bin(Utf8("15 minutes"), unbounded_csv_with_timestamps.ts)@0 DESC +07)------------AggregateExec: mode=Partial, gby=[date_bin(900000000000, ts@0) as date_bin(Utf8("15 minutes"), unbounded_csv_with_timestamps.ts)], aggr=[], ordering_mode=Sorted 08)--------------RepartitionExec: partitioning=RoundRobinBatch(8), input_partitions=1 09)----------------StreamingTableExec: partition_sizes=1, projection=[ts], infinite_source=true, output_ordering=[ts@0 DESC] @@ -4280,18 +4280,18 @@ EXPLAIN SELECT extract(month from ts) as months logical_plan 01)Limit: skip=0, fetch=5 02)--Sort: months DESC NULLS FIRST, fetch=5 -03)----Projection: date_part(Utf8("MONTH"),csv_with_timestamps.ts) AS months +03)----Projection: date_part(Utf8("MONTH"), csv_with_timestamps.ts) AS months 04)------Aggregate: groupBy=[[date_part(Utf8("MONTH"), csv_with_timestamps.ts)]], aggr=[[]] 05)--------TableScan: csv_with_timestamps projection=[ts] physical_plan 01)GlobalLimitExec: skip=0, fetch=5 02)--SortPreservingMergeExec: [months@0 DESC], fetch=5 03)----SortExec: TopK(fetch=5), expr=[months@0 DESC], preserve_partitioning=[true] -04)------ProjectionExec: expr=[date_part(Utf8("MONTH"),csv_with_timestamps.ts)@0 as months] -05)--------AggregateExec: mode=FinalPartitioned, gby=[date_part(Utf8("MONTH"),csv_with_timestamps.ts)@0 as date_part(Utf8("MONTH"),csv_with_timestamps.ts)], aggr=[] +04)------ProjectionExec: expr=[date_part(Utf8("MONTH"), csv_with_timestamps.ts)@0 as months] +05)--------AggregateExec: mode=FinalPartitioned, gby=[date_part(Utf8("MONTH"), csv_with_timestamps.ts)@0 as date_part(Utf8("MONTH"), csv_with_timestamps.ts)], aggr=[] 06)----------CoalesceBatchesExec: target_batch_size=2 -07)------------RepartitionExec: partitioning=Hash([date_part(Utf8("MONTH"),csv_with_timestamps.ts)@0], 8), input_partitions=8 -08)--------------AggregateExec: mode=Partial, gby=[date_part(MONTH, ts@0) as date_part(Utf8("MONTH"),csv_with_timestamps.ts)], aggr=[] +07)------------RepartitionExec: partitioning=Hash([date_part(Utf8("MONTH"), csv_with_timestamps.ts)@0], 8), input_partitions=8 +08)--------------AggregateExec: mode=Partial, gby=[date_part(MONTH, ts@0) as date_part(Utf8("MONTH"), csv_with_timestamps.ts)], aggr=[] 09)----------------RepartitionExec: partitioning=RoundRobinBatch(8), input_partitions=1 10)------------------CsvExec: file_groups={1 group: [[WORKSPACE_ROOT/datafusion/core/tests/data/timestamps.csv]]}, projection=[ts], output_ordering=[ts@0 DESC], has_header=false diff --git a/datafusion/sqllogictest/test_files/scalar.slt b/datafusion/sqllogictest/test_files/scalar.slt index c52881b7b0ba..94468675edb6 100644 --- a/datafusion/sqllogictest/test_files/scalar.slt +++ b/datafusion/sqllogictest/test_files/scalar.slt @@ -1871,10 +1871,10 @@ query TT EXPLAIN SELECT letter, letter = LEFT('APACHE', 1) FROM simple_string; ---- logical_plan -01)Projection: simple_string.letter, simple_string.letter = Utf8("A") AS simple_string.letter = left(Utf8("APACHE"),Int64(1)) +01)Projection: simple_string.letter, simple_string.letter = Utf8("A") AS simple_string.letter = left(Utf8("APACHE"), Int64(1)) 02)--TableScan: simple_string projection=[letter] physical_plan -01)ProjectionExec: expr=[letter@0 as letter, letter@0 = A as simple_string.letter = left(Utf8("APACHE"),Int64(1))] +01)ProjectionExec: expr=[letter@0 as letter, letter@0 = A as simple_string.letter = left(Utf8("APACHE"), Int64(1))] 02)--MemoryExec: partitions=1, partition_sizes=[1] query TB @@ -1893,7 +1893,7 @@ logical_plan 01)Projection: simple_string.letter, simple_string.letter = left(simple_string.letter2, Int64(1)) 02)--TableScan: simple_string projection=[letter, letter2] physical_plan -01)ProjectionExec: expr=[letter@0 as letter, letter@0 = left(letter2@1, 1) as simple_string.letter = left(simple_string.letter2,Int64(1))] +01)ProjectionExec: expr=[letter@0 as letter, letter@0 = left(letter2@1, 1) as simple_string.letter = left(simple_string.letter2, Int64(1))] 02)--MemoryExec: partitions=1, partition_sizes=[1] query TB diff --git a/datafusion/sqllogictest/test_files/select.slt b/datafusion/sqllogictest/test_files/select.slt index 24163e37dec3..6eaa472d7914 100644 --- a/datafusion/sqllogictest/test_files/select.slt +++ b/datafusion/sqllogictest/test_files/select.slt @@ -1487,7 +1487,7 @@ logical_plan 01)Projection: coalesce(Int64(1), CAST(t.y / t.x AS Int64)), coalesce(Int64(2), CAST(t.y / t.x AS Int64)) 02)--TableScan: t projection=[x, y] physical_plan -01)ProjectionExec: expr=[coalesce(1, CAST(y@1 / x@0 AS Int64)) as coalesce(Int64(1),t.y / t.x), coalesce(2, CAST(y@1 / x@0 AS Int64)) as coalesce(Int64(2),t.y / t.x)] +01)ProjectionExec: expr=[coalesce(1, CAST(y@1 / x@0 AS Int64)) as coalesce(Int64(1), t.y / t.x), coalesce(2, CAST(y@1 / x@0 AS Int64)) as coalesce(Int64(2), t.y / t.x)] 02)--MemoryExec: partitions=1, partition_sizes=[1] query TT diff --git a/datafusion/sqllogictest/test_files/struct.slt b/datafusion/sqllogictest/test_files/struct.slt index 46a08709c3a3..2add7d8501ed 100644 --- a/datafusion/sqllogictest/test_files/struct.slt +++ b/datafusion/sqllogictest/test_files/struct.slt @@ -88,7 +88,7 @@ logical_plan 01)Projection: struct(values.a, values.b, values.c) 02)--TableScan: values projection=[a, b, c] physical_plan -01)ProjectionExec: expr=[struct(a@0, b@1, c@2) as struct(values.a,values.b,values.c)] +01)ProjectionExec: expr=[struct(a@0, b@1, c@2) as struct(values.a, values.b, values.c)] 02)--MemoryExec: partitions=1, partition_sizes=[1] # error on 0 arguments diff --git a/datafusion/sqllogictest/test_files/window.slt b/datafusion/sqllogictest/test_files/window.slt index af09e644c9bf..74180baa7c34 100644 --- a/datafusion/sqllogictest/test_files/window.slt +++ b/datafusion/sqllogictest/test_files/window.slt @@ -1344,16 +1344,16 @@ EXPLAIN SELECT LIMIT 5 ---- logical_plan -01)Projection: aggregate_test_100.c9, FIRST_VALUE(aggregate_test_100.c9) ORDER BY [aggregate_test_100.c9 ASC NULLS LAST] ROWS BETWEEN 1 PRECEDING AND 5 FOLLOWING AS fv1, FIRST_VALUE(aggregate_test_100.c9) ORDER BY [aggregate_test_100.c9 DESC NULLS FIRST] ROWS BETWEEN 1 PRECEDING AND 5 FOLLOWING AS fv2, LAG(aggregate_test_100.c9,Int64(2),Int64(10101)) ORDER BY [aggregate_test_100.c9 ASC NULLS LAST] RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW AS lag1, LAG(aggregate_test_100.c9,Int64(2),Int64(10101)) ORDER BY [aggregate_test_100.c9 DESC NULLS FIRST] ROWS BETWEEN 10 PRECEDING AND 1 FOLLOWING AS lag2, LEAD(aggregate_test_100.c9,Int64(2),Int64(10101)) ORDER BY [aggregate_test_100.c9 ASC NULLS LAST] RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW AS lead1, LEAD(aggregate_test_100.c9,Int64(2),Int64(10101)) ORDER BY [aggregate_test_100.c9 DESC NULLS FIRST] ROWS BETWEEN 10 PRECEDING AND 1 FOLLOWING AS lead2 +01)Projection: aggregate_test_100.c9, FIRST_VALUE(aggregate_test_100.c9) ORDER BY [aggregate_test_100.c9 ASC NULLS LAST] ROWS BETWEEN 1 PRECEDING AND 5 FOLLOWING AS fv1, FIRST_VALUE(aggregate_test_100.c9) ORDER BY [aggregate_test_100.c9 DESC NULLS FIRST] ROWS BETWEEN 1 PRECEDING AND 5 FOLLOWING AS fv2, LAG(aggregate_test_100.c9, Int64(2), Int64(10101)) ORDER BY [aggregate_test_100.c9 ASC NULLS LAST] RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW AS lag1, LAG(aggregate_test_100.c9, Int64(2), Int64(10101)) ORDER BY [aggregate_test_100.c9 DESC NULLS FIRST] ROWS BETWEEN 10 PRECEDING AND 1 FOLLOWING AS lag2, LEAD(aggregate_test_100.c9, Int64(2), Int64(10101)) ORDER BY [aggregate_test_100.c9 ASC NULLS LAST] RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW AS lead1, LEAD(aggregate_test_100.c9, Int64(2), Int64(10101)) ORDER BY [aggregate_test_100.c9 DESC NULLS FIRST] ROWS BETWEEN 10 PRECEDING AND 1 FOLLOWING AS lead2 02)--Limit: skip=0, fetch=5 03)----WindowAggr: windowExpr=[[FIRST_VALUE(aggregate_test_100.c9) ORDER BY [aggregate_test_100.c9 ASC NULLS LAST] ROWS BETWEEN 1 PRECEDING AND 5 FOLLOWING, LAG(aggregate_test_100.c9, Int64(2), Int64(10101)) ORDER BY [aggregate_test_100.c9 ASC NULLS LAST] RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW, LEAD(aggregate_test_100.c9, Int64(2), Int64(10101)) ORDER BY [aggregate_test_100.c9 ASC NULLS LAST] RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW]] 04)------WindowAggr: windowExpr=[[FIRST_VALUE(aggregate_test_100.c9) ORDER BY [aggregate_test_100.c9 DESC NULLS FIRST] ROWS BETWEEN 1 PRECEDING AND 5 FOLLOWING, LAG(aggregate_test_100.c9, Int64(2), Int64(10101)) ORDER BY [aggregate_test_100.c9 DESC NULLS FIRST] ROWS BETWEEN 10 PRECEDING AND 1 FOLLOWING, LEAD(aggregate_test_100.c9, Int64(2), Int64(10101)) ORDER BY [aggregate_test_100.c9 DESC NULLS FIRST] ROWS BETWEEN 10 PRECEDING AND 1 FOLLOWING]] 05)--------TableScan: aggregate_test_100 projection=[c9] physical_plan -01)ProjectionExec: expr=[c9@0 as c9, FIRST_VALUE(aggregate_test_100.c9) ORDER BY [aggregate_test_100.c9 ASC NULLS LAST] ROWS BETWEEN 1 PRECEDING AND 5 FOLLOWING@4 as fv1, FIRST_VALUE(aggregate_test_100.c9) ORDER BY [aggregate_test_100.c9 DESC NULLS FIRST] ROWS BETWEEN 1 PRECEDING AND 5 FOLLOWING@1 as fv2, LAG(aggregate_test_100.c9,Int64(2),Int64(10101)) ORDER BY [aggregate_test_100.c9 ASC NULLS LAST] RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW@5 as lag1, LAG(aggregate_test_100.c9,Int64(2),Int64(10101)) ORDER BY [aggregate_test_100.c9 DESC NULLS FIRST] ROWS BETWEEN 10 PRECEDING AND 1 FOLLOWING@2 as lag2, LEAD(aggregate_test_100.c9,Int64(2),Int64(10101)) ORDER BY [aggregate_test_100.c9 ASC NULLS LAST] RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW@6 as lead1, LEAD(aggregate_test_100.c9,Int64(2),Int64(10101)) ORDER BY [aggregate_test_100.c9 DESC NULLS FIRST] ROWS BETWEEN 10 PRECEDING AND 1 FOLLOWING@3 as lead2] +01)ProjectionExec: expr=[c9@0 as c9, FIRST_VALUE(aggregate_test_100.c9) ORDER BY [aggregate_test_100.c9 ASC NULLS LAST] ROWS BETWEEN 1 PRECEDING AND 5 FOLLOWING@4 as fv1, FIRST_VALUE(aggregate_test_100.c9) ORDER BY [aggregate_test_100.c9 DESC NULLS FIRST] ROWS BETWEEN 1 PRECEDING AND 5 FOLLOWING@1 as fv2, LAG(aggregate_test_100.c9, Int64(2), Int64(10101)) ORDER BY [aggregate_test_100.c9 ASC NULLS LAST] RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW@5 as lag1, LAG(aggregate_test_100.c9, Int64(2), Int64(10101)) ORDER BY [aggregate_test_100.c9 DESC NULLS FIRST] ROWS BETWEEN 10 PRECEDING AND 1 FOLLOWING@2 as lag2, LEAD(aggregate_test_100.c9, Int64(2), Int64(10101)) ORDER BY [aggregate_test_100.c9 ASC NULLS LAST] RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW@6 as lead1, LEAD(aggregate_test_100.c9, Int64(2), Int64(10101)) ORDER BY [aggregate_test_100.c9 DESC NULLS FIRST] ROWS BETWEEN 10 PRECEDING AND 1 FOLLOWING@3 as lead2] 02)--GlobalLimitExec: skip=0, fetch=5 -03)----BoundedWindowAggExec: wdw=[FIRST_VALUE(aggregate_test_100.c9) ORDER BY [aggregate_test_100.c9 ASC NULLS LAST] ROWS BETWEEN 1 PRECEDING AND 5 FOLLOWING: Ok(Field { name: "FIRST_VALUE(aggregate_test_100.c9) ORDER BY [aggregate_test_100.c9 ASC NULLS LAST] ROWS BETWEEN 1 PRECEDING AND 5 FOLLOWING", data_type: UInt64, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }), frame: WindowFrame { units: Rows, start_bound: Preceding(UInt64(5)), end_bound: Following(UInt64(1)), is_causal: false }, LAG(aggregate_test_100.c9,Int64(2),Int64(10101)) ORDER BY [aggregate_test_100.c9 ASC NULLS LAST] RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW: Ok(Field { name: "LAG(aggregate_test_100.c9,Int64(2),Int64(10101)) ORDER BY [aggregate_test_100.c9 ASC NULLS LAST] RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW", data_type: UInt64, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }), frame: WindowFrame { units: Range, start_bound: CurrentRow, end_bound: Following(UInt64(NULL)), is_causal: false }, LEAD(aggregate_test_100.c9,Int64(2),Int64(10101)) ORDER BY [aggregate_test_100.c9 ASC NULLS LAST] RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW: Ok(Field { name: "LEAD(aggregate_test_100.c9,Int64(2),Int64(10101)) ORDER BY [aggregate_test_100.c9 ASC NULLS LAST] RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW", data_type: UInt64, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }), frame: WindowFrame { units: Range, start_bound: CurrentRow, end_bound: Following(UInt64(NULL)), is_causal: false }], mode=[Sorted] -04)------BoundedWindowAggExec: wdw=[FIRST_VALUE(aggregate_test_100.c9) ORDER BY [aggregate_test_100.c9 DESC NULLS FIRST] ROWS BETWEEN 1 PRECEDING AND 5 FOLLOWING: Ok(Field { name: "FIRST_VALUE(aggregate_test_100.c9) ORDER BY [aggregate_test_100.c9 DESC NULLS FIRST] ROWS BETWEEN 1 PRECEDING AND 5 FOLLOWING", data_type: UInt64, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }), frame: WindowFrame { units: Rows, start_bound: Preceding(UInt64(1)), end_bound: Following(UInt64(5)), is_causal: false }, LAG(aggregate_test_100.c9,Int64(2),Int64(10101)) ORDER BY [aggregate_test_100.c9 DESC NULLS FIRST] ROWS BETWEEN 10 PRECEDING AND 1 FOLLOWING: Ok(Field { name: "LAG(aggregate_test_100.c9,Int64(2),Int64(10101)) ORDER BY [aggregate_test_100.c9 DESC NULLS FIRST] ROWS BETWEEN 10 PRECEDING AND 1 FOLLOWING", data_type: UInt64, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }), frame: WindowFrame { units: Rows, start_bound: Preceding(UInt64(10)), end_bound: Following(UInt64(1)), is_causal: false }, LEAD(aggregate_test_100.c9,Int64(2),Int64(10101)) ORDER BY [aggregate_test_100.c9 DESC NULLS FIRST] ROWS BETWEEN 10 PRECEDING AND 1 FOLLOWING: Ok(Field { name: "LEAD(aggregate_test_100.c9,Int64(2),Int64(10101)) ORDER BY [aggregate_test_100.c9 DESC NULLS FIRST] ROWS BETWEEN 10 PRECEDING AND 1 FOLLOWING", data_type: UInt64, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }), frame: WindowFrame { units: Rows, start_bound: Preceding(UInt64(10)), end_bound: Following(UInt64(1)), is_causal: false }], mode=[Sorted] +03)----BoundedWindowAggExec: wdw=[FIRST_VALUE(aggregate_test_100.c9) ORDER BY [aggregate_test_100.c9 ASC NULLS LAST] ROWS BETWEEN 1 PRECEDING AND 5 FOLLOWING: Ok(Field { name: "FIRST_VALUE(aggregate_test_100.c9) ORDER BY [aggregate_test_100.c9 ASC NULLS LAST] ROWS BETWEEN 1 PRECEDING AND 5 FOLLOWING", data_type: UInt64, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }), frame: WindowFrame { units: Rows, start_bound: Preceding(UInt64(5)), end_bound: Following(UInt64(1)), is_causal: false }, LAG(aggregate_test_100.c9, Int64(2), Int64(10101)) ORDER BY [aggregate_test_100.c9 ASC NULLS LAST] RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW: Ok(Field { name: "LAG(aggregate_test_100.c9, Int64(2), Int64(10101)) ORDER BY [aggregate_test_100.c9 ASC NULLS LAST] RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW", data_type: UInt64, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }), frame: WindowFrame { units: Range, start_bound: CurrentRow, end_bound: Following(UInt64(NULL)), is_causal: false }, LEAD(aggregate_test_100.c9, Int64(2), Int64(10101)) ORDER BY [aggregate_test_100.c9 ASC NULLS LAST] RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW: Ok(Field { name: "LEAD(aggregate_test_100.c9, Int64(2), Int64(10101)) ORDER BY [aggregate_test_100.c9 ASC NULLS LAST] RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW", data_type: UInt64, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }), frame: WindowFrame { units: Range, start_bound: CurrentRow, end_bound: Following(UInt64(NULL)), is_causal: false }], mode=[Sorted] +04)------BoundedWindowAggExec: wdw=[FIRST_VALUE(aggregate_test_100.c9) ORDER BY [aggregate_test_100.c9 DESC NULLS FIRST] ROWS BETWEEN 1 PRECEDING AND 5 FOLLOWING: Ok(Field { name: "FIRST_VALUE(aggregate_test_100.c9) ORDER BY [aggregate_test_100.c9 DESC NULLS FIRST] ROWS BETWEEN 1 PRECEDING AND 5 FOLLOWING", data_type: UInt64, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }), frame: WindowFrame { units: Rows, start_bound: Preceding(UInt64(1)), end_bound: Following(UInt64(5)), is_causal: false }, LAG(aggregate_test_100.c9, Int64(2), Int64(10101)) ORDER BY [aggregate_test_100.c9 DESC NULLS FIRST] ROWS BETWEEN 10 PRECEDING AND 1 FOLLOWING: Ok(Field { name: "LAG(aggregate_test_100.c9, Int64(2), Int64(10101)) ORDER BY [aggregate_test_100.c9 DESC NULLS FIRST] ROWS BETWEEN 10 PRECEDING AND 1 FOLLOWING", data_type: UInt64, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }), frame: WindowFrame { units: Rows, start_bound: Preceding(UInt64(10)), end_bound: Following(UInt64(1)), is_causal: false }, LEAD(aggregate_test_100.c9, Int64(2), Int64(10101)) ORDER BY [aggregate_test_100.c9 DESC NULLS FIRST] ROWS BETWEEN 10 PRECEDING AND 1 FOLLOWING: Ok(Field { name: "LEAD(aggregate_test_100.c9, Int64(2), Int64(10101)) ORDER BY [aggregate_test_100.c9 DESC NULLS FIRST] ROWS BETWEEN 10 PRECEDING AND 1 FOLLOWING", data_type: UInt64, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }), frame: WindowFrame { units: Rows, start_bound: Preceding(UInt64(10)), end_bound: Following(UInt64(1)), is_causal: false }], mode=[Sorted] 05)--------SortExec: expr=[c9@0 DESC], preserve_partitioning=[false] 06)----------CsvExec: file_groups={1 group: [[WORKSPACE_ROOT/testing/data/csv/aggregate_test_100.csv]]}, projection=[c9], has_header=true @@ -2635,16 +2635,16 @@ EXPLAIN SELECT logical_plan 01)Limit: skip=0, fetch=5 02)--Sort: annotated_data_finite.ts DESC NULLS FIRST, fetch=5 -03)----Projection: annotated_data_finite.ts, FIRST_VALUE(annotated_data_finite.inc_col) ORDER BY [annotated_data_finite.ts ASC NULLS LAST] RANGE BETWEEN 10 PRECEDING AND 1 FOLLOWING AS fv1, FIRST_VALUE(annotated_data_finite.inc_col) ORDER BY [annotated_data_finite.ts ASC NULLS LAST] ROWS BETWEEN 10 PRECEDING AND 1 FOLLOWING AS fv2, LAST_VALUE(annotated_data_finite.inc_col) ORDER BY [annotated_data_finite.ts ASC NULLS LAST] RANGE BETWEEN 10 PRECEDING AND 1 FOLLOWING AS lv1, LAST_VALUE(annotated_data_finite.inc_col) ORDER BY [annotated_data_finite.ts ASC NULLS LAST] ROWS BETWEEN 10 PRECEDING AND 1 FOLLOWING AS lv2, NTH_VALUE(annotated_data_finite.inc_col,Int64(5)) ORDER BY [annotated_data_finite.ts ASC NULLS LAST] RANGE BETWEEN 10 PRECEDING AND 1 FOLLOWING AS nv1, NTH_VALUE(annotated_data_finite.inc_col,Int64(5)) ORDER BY [annotated_data_finite.ts ASC NULLS LAST] ROWS BETWEEN 10 PRECEDING AND 1 FOLLOWING AS nv2, ROW_NUMBER() ORDER BY [annotated_data_finite.ts ASC NULLS LAST] RANGE BETWEEN 1 PRECEDING AND 10 FOLLOWING AS rn1, ROW_NUMBER() ORDER BY [annotated_data_finite.ts ASC NULLS LAST] ROWS BETWEEN 10 PRECEDING AND 1 FOLLOWING AS rn2, RANK() ORDER BY [annotated_data_finite.ts ASC NULLS LAST] RANGE BETWEEN 1 PRECEDING AND 10 FOLLOWING AS rank1, RANK() ORDER BY [annotated_data_finite.ts ASC NULLS LAST] ROWS BETWEEN 10 PRECEDING AND 1 FOLLOWING AS rank2, DENSE_RANK() ORDER BY [annotated_data_finite.ts ASC NULLS LAST] RANGE BETWEEN 1 PRECEDING AND 10 FOLLOWING AS dense_rank1, DENSE_RANK() ORDER BY [annotated_data_finite.ts ASC NULLS LAST] ROWS BETWEEN 10 PRECEDING AND 1 FOLLOWING AS dense_rank2, LAG(annotated_data_finite.inc_col,Int64(1),Int64(1001)) ORDER BY [annotated_data_finite.ts ASC NULLS LAST] RANGE BETWEEN 1 PRECEDING AND 10 FOLLOWING AS lag1, LAG(annotated_data_finite.inc_col,Int64(2),Int64(1002)) ORDER BY [annotated_data_finite.ts ASC NULLS LAST] ROWS BETWEEN 10 PRECEDING AND 1 FOLLOWING AS lag2, LEAD(annotated_data_finite.inc_col,Int64(-1),Int64(1001)) ORDER BY [annotated_data_finite.ts ASC NULLS LAST] RANGE BETWEEN 1 PRECEDING AND 10 FOLLOWING AS lead1, LEAD(annotated_data_finite.inc_col,Int64(4),Int64(1004)) ORDER BY [annotated_data_finite.ts ASC NULLS LAST] ROWS BETWEEN 10 PRECEDING AND 1 FOLLOWING AS lead2, FIRST_VALUE(annotated_data_finite.inc_col) ORDER BY [annotated_data_finite.ts DESC NULLS FIRST] RANGE BETWEEN 10 PRECEDING AND 1 FOLLOWING AS fvr1, FIRST_VALUE(annotated_data_finite.inc_col) ORDER BY [annotated_data_finite.ts DESC NULLS FIRST] ROWS BETWEEN 10 PRECEDING AND 1 FOLLOWING AS fvr2, LAST_VALUE(annotated_data_finite.inc_col) ORDER BY [annotated_data_finite.ts DESC NULLS FIRST] RANGE BETWEEN 10 PRECEDING AND 1 FOLLOWING AS lvr1, LAST_VALUE(annotated_data_finite.inc_col) ORDER BY [annotated_data_finite.ts DESC NULLS FIRST] ROWS BETWEEN 10 PRECEDING AND 1 FOLLOWING AS lvr2, LAG(annotated_data_finite.inc_col,Int64(1),Int64(1001)) ORDER BY [annotated_data_finite.ts DESC NULLS FIRST] RANGE BETWEEN 1 PRECEDING AND 10 FOLLOWING AS lagr1, LAG(annotated_data_finite.inc_col,Int64(2),Int64(1002)) ORDER BY [annotated_data_finite.ts DESC NULLS FIRST] ROWS BETWEEN 10 PRECEDING AND 1 FOLLOWING AS lagr2, LEAD(annotated_data_finite.inc_col,Int64(-1),Int64(1001)) ORDER BY [annotated_data_finite.ts DESC NULLS FIRST] RANGE BETWEEN 1 PRECEDING AND 10 FOLLOWING AS leadr1, LEAD(annotated_data_finite.inc_col,Int64(4),Int64(1004)) ORDER BY [annotated_data_finite.ts DESC NULLS FIRST] ROWS BETWEEN 10 PRECEDING AND 1 FOLLOWING AS leadr2 +03)----Projection: annotated_data_finite.ts, FIRST_VALUE(annotated_data_finite.inc_col) ORDER BY [annotated_data_finite.ts ASC NULLS LAST] RANGE BETWEEN 10 PRECEDING AND 1 FOLLOWING AS fv1, FIRST_VALUE(annotated_data_finite.inc_col) ORDER BY [annotated_data_finite.ts ASC NULLS LAST] ROWS BETWEEN 10 PRECEDING AND 1 FOLLOWING AS fv2, LAST_VALUE(annotated_data_finite.inc_col) ORDER BY [annotated_data_finite.ts ASC NULLS LAST] RANGE BETWEEN 10 PRECEDING AND 1 FOLLOWING AS lv1, LAST_VALUE(annotated_data_finite.inc_col) ORDER BY [annotated_data_finite.ts ASC NULLS LAST] ROWS BETWEEN 10 PRECEDING AND 1 FOLLOWING AS lv2, NTH_VALUE(annotated_data_finite.inc_col, Int64(5)) ORDER BY [annotated_data_finite.ts ASC NULLS LAST] RANGE BETWEEN 10 PRECEDING AND 1 FOLLOWING AS nv1, NTH_VALUE(annotated_data_finite.inc_col, Int64(5)) ORDER BY [annotated_data_finite.ts ASC NULLS LAST] ROWS BETWEEN 10 PRECEDING AND 1 FOLLOWING AS nv2, ROW_NUMBER() ORDER BY [annotated_data_finite.ts ASC NULLS LAST] RANGE BETWEEN 1 PRECEDING AND 10 FOLLOWING AS rn1, ROW_NUMBER() ORDER BY [annotated_data_finite.ts ASC NULLS LAST] ROWS BETWEEN 10 PRECEDING AND 1 FOLLOWING AS rn2, RANK() ORDER BY [annotated_data_finite.ts ASC NULLS LAST] RANGE BETWEEN 1 PRECEDING AND 10 FOLLOWING AS rank1, RANK() ORDER BY [annotated_data_finite.ts ASC NULLS LAST] ROWS BETWEEN 10 PRECEDING AND 1 FOLLOWING AS rank2, DENSE_RANK() ORDER BY [annotated_data_finite.ts ASC NULLS LAST] RANGE BETWEEN 1 PRECEDING AND 10 FOLLOWING AS dense_rank1, DENSE_RANK() ORDER BY [annotated_data_finite.ts ASC NULLS LAST] ROWS BETWEEN 10 PRECEDING AND 1 FOLLOWING AS dense_rank2, LAG(annotated_data_finite.inc_col, Int64(1), Int64(1001)) ORDER BY [annotated_data_finite.ts ASC NULLS LAST] RANGE BETWEEN 1 PRECEDING AND 10 FOLLOWING AS lag1, LAG(annotated_data_finite.inc_col, Int64(2), Int64(1002)) ORDER BY [annotated_data_finite.ts ASC NULLS LAST] ROWS BETWEEN 10 PRECEDING AND 1 FOLLOWING AS lag2, LEAD(annotated_data_finite.inc_col, Int64(-1), Int64(1001)) ORDER BY [annotated_data_finite.ts ASC NULLS LAST] RANGE BETWEEN 1 PRECEDING AND 10 FOLLOWING AS lead1, LEAD(annotated_data_finite.inc_col, Int64(4), Int64(1004)) ORDER BY [annotated_data_finite.ts ASC NULLS LAST] ROWS BETWEEN 10 PRECEDING AND 1 FOLLOWING AS lead2, FIRST_VALUE(annotated_data_finite.inc_col) ORDER BY [annotated_data_finite.ts DESC NULLS FIRST] RANGE BETWEEN 10 PRECEDING AND 1 FOLLOWING AS fvr1, FIRST_VALUE(annotated_data_finite.inc_col) ORDER BY [annotated_data_finite.ts DESC NULLS FIRST] ROWS BETWEEN 10 PRECEDING AND 1 FOLLOWING AS fvr2, LAST_VALUE(annotated_data_finite.inc_col) ORDER BY [annotated_data_finite.ts DESC NULLS FIRST] RANGE BETWEEN 10 PRECEDING AND 1 FOLLOWING AS lvr1, LAST_VALUE(annotated_data_finite.inc_col) ORDER BY [annotated_data_finite.ts DESC NULLS FIRST] ROWS BETWEEN 10 PRECEDING AND 1 FOLLOWING AS lvr2, LAG(annotated_data_finite.inc_col, Int64(1), Int64(1001)) ORDER BY [annotated_data_finite.ts DESC NULLS FIRST] RANGE BETWEEN 1 PRECEDING AND 10 FOLLOWING AS lagr1, LAG(annotated_data_finite.inc_col, Int64(2), Int64(1002)) ORDER BY [annotated_data_finite.ts DESC NULLS FIRST] ROWS BETWEEN 10 PRECEDING AND 1 FOLLOWING AS lagr2, LEAD(annotated_data_finite.inc_col, Int64(-1), Int64(1001)) ORDER BY [annotated_data_finite.ts DESC NULLS FIRST] RANGE BETWEEN 1 PRECEDING AND 10 FOLLOWING AS leadr1, LEAD(annotated_data_finite.inc_col, Int64(4), Int64(1004)) ORDER BY [annotated_data_finite.ts DESC NULLS FIRST] ROWS BETWEEN 10 PRECEDING AND 1 FOLLOWING AS leadr2 04)------WindowAggr: windowExpr=[[FIRST_VALUE(annotated_data_finite.inc_col) ORDER BY [annotated_data_finite.ts ASC NULLS LAST] RANGE BETWEEN 10 PRECEDING AND 1 FOLLOWING, FIRST_VALUE(annotated_data_finite.inc_col) ORDER BY [annotated_data_finite.ts ASC NULLS LAST] ROWS BETWEEN 10 PRECEDING AND 1 FOLLOWING, LAST_VALUE(annotated_data_finite.inc_col) ORDER BY [annotated_data_finite.ts ASC NULLS LAST] RANGE BETWEEN 10 PRECEDING AND 1 FOLLOWING, LAST_VALUE(annotated_data_finite.inc_col) ORDER BY [annotated_data_finite.ts ASC NULLS LAST] ROWS BETWEEN 10 PRECEDING AND 1 FOLLOWING, NTH_VALUE(annotated_data_finite.inc_col, Int64(5)) ORDER BY [annotated_data_finite.ts ASC NULLS LAST] RANGE BETWEEN 10 PRECEDING AND 1 FOLLOWING, NTH_VALUE(annotated_data_finite.inc_col, Int64(5)) ORDER BY [annotated_data_finite.ts ASC NULLS LAST] ROWS BETWEEN 10 PRECEDING AND 1 FOLLOWING, ROW_NUMBER() ORDER BY [annotated_data_finite.ts ASC NULLS LAST] RANGE BETWEEN 1 PRECEDING AND 10 FOLLOWING, ROW_NUMBER() ORDER BY [annotated_data_finite.ts ASC NULLS LAST] ROWS BETWEEN 10 PRECEDING AND 1 FOLLOWING, RANK() ORDER BY [annotated_data_finite.ts ASC NULLS LAST] RANGE BETWEEN 1 PRECEDING AND 10 FOLLOWING, RANK() ORDER BY [annotated_data_finite.ts ASC NULLS LAST] ROWS BETWEEN 10 PRECEDING AND 1 FOLLOWING, DENSE_RANK() ORDER BY [annotated_data_finite.ts ASC NULLS LAST] RANGE BETWEEN 1 PRECEDING AND 10 FOLLOWING, DENSE_RANK() ORDER BY [annotated_data_finite.ts ASC NULLS LAST] ROWS BETWEEN 10 PRECEDING AND 1 FOLLOWING, LAG(annotated_data_finite.inc_col, Int64(1), Int64(1001)) ORDER BY [annotated_data_finite.ts ASC NULLS LAST] RANGE BETWEEN 1 PRECEDING AND 10 FOLLOWING, LAG(annotated_data_finite.inc_col, Int64(2), Int64(1002)) ORDER BY [annotated_data_finite.ts ASC NULLS LAST] ROWS BETWEEN 10 PRECEDING AND 1 FOLLOWING, LEAD(annotated_data_finite.inc_col, Int64(-1), Int64(1001)) ORDER BY [annotated_data_finite.ts ASC NULLS LAST] RANGE BETWEEN 1 PRECEDING AND 10 FOLLOWING, LEAD(annotated_data_finite.inc_col, Int64(4), Int64(1004)) ORDER BY [annotated_data_finite.ts ASC NULLS LAST] ROWS BETWEEN 10 PRECEDING AND 1 FOLLOWING]] 05)--------WindowAggr: windowExpr=[[FIRST_VALUE(annotated_data_finite.inc_col) ORDER BY [annotated_data_finite.ts DESC NULLS FIRST] RANGE BETWEEN 10 PRECEDING AND 1 FOLLOWING, FIRST_VALUE(annotated_data_finite.inc_col) ORDER BY [annotated_data_finite.ts DESC NULLS FIRST] ROWS BETWEEN 10 PRECEDING AND 1 FOLLOWING, LAST_VALUE(annotated_data_finite.inc_col) ORDER BY [annotated_data_finite.ts DESC NULLS FIRST] RANGE BETWEEN 10 PRECEDING AND 1 FOLLOWING, LAST_VALUE(annotated_data_finite.inc_col) ORDER BY [annotated_data_finite.ts DESC NULLS FIRST] ROWS BETWEEN 10 PRECEDING AND 1 FOLLOWING, LAG(annotated_data_finite.inc_col, Int64(1), Int64(1001)) ORDER BY [annotated_data_finite.ts DESC NULLS FIRST] RANGE BETWEEN 1 PRECEDING AND 10 FOLLOWING, LAG(annotated_data_finite.inc_col, Int64(2), Int64(1002)) ORDER BY [annotated_data_finite.ts DESC NULLS FIRST] ROWS BETWEEN 10 PRECEDING AND 1 FOLLOWING, LEAD(annotated_data_finite.inc_col, Int64(-1), Int64(1001)) ORDER BY [annotated_data_finite.ts DESC NULLS FIRST] RANGE BETWEEN 1 PRECEDING AND 10 FOLLOWING, LEAD(annotated_data_finite.inc_col, Int64(4), Int64(1004)) ORDER BY [annotated_data_finite.ts DESC NULLS FIRST] ROWS BETWEEN 10 PRECEDING AND 1 FOLLOWING]] 06)----------TableScan: annotated_data_finite projection=[ts, inc_col] physical_plan 01)GlobalLimitExec: skip=0, fetch=5 02)--SortExec: TopK(fetch=5), expr=[ts@0 DESC], preserve_partitioning=[false] -03)----ProjectionExec: expr=[ts@0 as ts, FIRST_VALUE(annotated_data_finite.inc_col) ORDER BY [annotated_data_finite.ts ASC NULLS LAST] RANGE BETWEEN 10 PRECEDING AND 1 FOLLOWING@10 as fv1, FIRST_VALUE(annotated_data_finite.inc_col) ORDER BY [annotated_data_finite.ts ASC NULLS LAST] ROWS BETWEEN 10 PRECEDING AND 1 FOLLOWING@11 as fv2, LAST_VALUE(annotated_data_finite.inc_col) ORDER BY [annotated_data_finite.ts ASC NULLS LAST] RANGE BETWEEN 10 PRECEDING AND 1 FOLLOWING@12 as lv1, LAST_VALUE(annotated_data_finite.inc_col) ORDER BY [annotated_data_finite.ts ASC NULLS LAST] ROWS BETWEEN 10 PRECEDING AND 1 FOLLOWING@13 as lv2, NTH_VALUE(annotated_data_finite.inc_col,Int64(5)) ORDER BY [annotated_data_finite.ts ASC NULLS LAST] RANGE BETWEEN 10 PRECEDING AND 1 FOLLOWING@14 as nv1, NTH_VALUE(annotated_data_finite.inc_col,Int64(5)) ORDER BY [annotated_data_finite.ts ASC NULLS LAST] ROWS BETWEEN 10 PRECEDING AND 1 FOLLOWING@15 as nv2, ROW_NUMBER() ORDER BY [annotated_data_finite.ts ASC NULLS LAST] RANGE BETWEEN 1 PRECEDING AND 10 FOLLOWING@16 as rn1, ROW_NUMBER() ORDER BY [annotated_data_finite.ts ASC NULLS LAST] ROWS BETWEEN 10 PRECEDING AND 1 FOLLOWING@17 as rn2, RANK() ORDER BY [annotated_data_finite.ts ASC NULLS LAST] RANGE BETWEEN 1 PRECEDING AND 10 FOLLOWING@18 as rank1, RANK() ORDER BY [annotated_data_finite.ts ASC NULLS LAST] ROWS BETWEEN 10 PRECEDING AND 1 FOLLOWING@19 as rank2, DENSE_RANK() ORDER BY [annotated_data_finite.ts ASC NULLS LAST] RANGE BETWEEN 1 PRECEDING AND 10 FOLLOWING@20 as dense_rank1, DENSE_RANK() ORDER BY [annotated_data_finite.ts ASC NULLS LAST] ROWS BETWEEN 10 PRECEDING AND 1 FOLLOWING@21 as dense_rank2, LAG(annotated_data_finite.inc_col,Int64(1),Int64(1001)) ORDER BY [annotated_data_finite.ts ASC NULLS LAST] RANGE BETWEEN 1 PRECEDING AND 10 FOLLOWING@22 as lag1, LAG(annotated_data_finite.inc_col,Int64(2),Int64(1002)) ORDER BY [annotated_data_finite.ts ASC NULLS LAST] ROWS BETWEEN 10 PRECEDING AND 1 FOLLOWING@23 as lag2, LEAD(annotated_data_finite.inc_col,Int64(-1),Int64(1001)) ORDER BY [annotated_data_finite.ts ASC NULLS LAST] RANGE BETWEEN 1 PRECEDING AND 10 FOLLOWING@24 as lead1, LEAD(annotated_data_finite.inc_col,Int64(4),Int64(1004)) ORDER BY [annotated_data_finite.ts ASC NULLS LAST] ROWS BETWEEN 10 PRECEDING AND 1 FOLLOWING@25 as lead2, FIRST_VALUE(annotated_data_finite.inc_col) ORDER BY [annotated_data_finite.ts DESC NULLS FIRST] RANGE BETWEEN 10 PRECEDING AND 1 FOLLOWING@2 as fvr1, FIRST_VALUE(annotated_data_finite.inc_col) ORDER BY [annotated_data_finite.ts DESC NULLS FIRST] ROWS BETWEEN 10 PRECEDING AND 1 FOLLOWING@3 as fvr2, LAST_VALUE(annotated_data_finite.inc_col) ORDER BY [annotated_data_finite.ts DESC NULLS FIRST] RANGE BETWEEN 10 PRECEDING AND 1 FOLLOWING@4 as lvr1, LAST_VALUE(annotated_data_finite.inc_col) ORDER BY [annotated_data_finite.ts DESC NULLS FIRST] ROWS BETWEEN 10 PRECEDING AND 1 FOLLOWING@5 as lvr2, LAG(annotated_data_finite.inc_col,Int64(1),Int64(1001)) ORDER BY [annotated_data_finite.ts DESC NULLS FIRST] RANGE BETWEEN 1 PRECEDING AND 10 FOLLOWING@6 as lagr1, LAG(annotated_data_finite.inc_col,Int64(2),Int64(1002)) ORDER BY [annotated_data_finite.ts DESC NULLS FIRST] ROWS BETWEEN 10 PRECEDING AND 1 FOLLOWING@7 as lagr2, LEAD(annotated_data_finite.inc_col,Int64(-1),Int64(1001)) ORDER BY [annotated_data_finite.ts DESC NULLS FIRST] RANGE BETWEEN 1 PRECEDING AND 10 FOLLOWING@8 as leadr1, LEAD(annotated_data_finite.inc_col,Int64(4),Int64(1004)) ORDER BY [annotated_data_finite.ts DESC NULLS FIRST] ROWS BETWEEN 10 PRECEDING AND 1 FOLLOWING@9 as leadr2] -04)------BoundedWindowAggExec: wdw=[FIRST_VALUE(annotated_data_finite.inc_col) ORDER BY [annotated_data_finite.ts ASC NULLS LAST] RANGE BETWEEN 10 PRECEDING AND 1 FOLLOWING: Ok(Field { name: "FIRST_VALUE(annotated_data_finite.inc_col) ORDER BY [annotated_data_finite.ts ASC NULLS LAST] RANGE BETWEEN 10 PRECEDING AND 1 FOLLOWING", data_type: Int32, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }), frame: WindowFrame { units: Range, start_bound: Preceding(Int32(10)), end_bound: Following(Int32(1)), is_causal: false }, FIRST_VALUE(annotated_data_finite.inc_col) ORDER BY [annotated_data_finite.ts ASC NULLS LAST] ROWS BETWEEN 10 PRECEDING AND 1 FOLLOWING: Ok(Field { name: "FIRST_VALUE(annotated_data_finite.inc_col) ORDER BY [annotated_data_finite.ts ASC NULLS LAST] ROWS BETWEEN 10 PRECEDING AND 1 FOLLOWING", data_type: Int32, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }), frame: WindowFrame { units: Rows, start_bound: Preceding(UInt64(10)), end_bound: Following(UInt64(1)), is_causal: false }, LAST_VALUE(annotated_data_finite.inc_col) ORDER BY [annotated_data_finite.ts ASC NULLS LAST] RANGE BETWEEN 10 PRECEDING AND 1 FOLLOWING: Ok(Field { name: "LAST_VALUE(annotated_data_finite.inc_col) ORDER BY [annotated_data_finite.ts ASC NULLS LAST] RANGE BETWEEN 10 PRECEDING AND 1 FOLLOWING", data_type: Int32, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }), frame: WindowFrame { units: Range, start_bound: Preceding(Int32(10)), end_bound: Following(Int32(1)), is_causal: false }, LAST_VALUE(annotated_data_finite.inc_col) ORDER BY [annotated_data_finite.ts ASC NULLS LAST] ROWS BETWEEN 10 PRECEDING AND 1 FOLLOWING: Ok(Field { name: "LAST_VALUE(annotated_data_finite.inc_col) ORDER BY [annotated_data_finite.ts ASC NULLS LAST] ROWS BETWEEN 10 PRECEDING AND 1 FOLLOWING", data_type: Int32, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }), frame: WindowFrame { units: Rows, start_bound: Preceding(UInt64(10)), end_bound: Following(UInt64(1)), is_causal: false }, NTH_VALUE(annotated_data_finite.inc_col,Int64(5)) ORDER BY [annotated_data_finite.ts ASC NULLS LAST] RANGE BETWEEN 10 PRECEDING AND 1 FOLLOWING: Ok(Field { name: "NTH_VALUE(annotated_data_finite.inc_col,Int64(5)) ORDER BY [annotated_data_finite.ts ASC NULLS LAST] RANGE BETWEEN 10 PRECEDING AND 1 FOLLOWING", data_type: Int32, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }), frame: WindowFrame { units: Range, start_bound: Preceding(Int32(10)), end_bound: Following(Int32(1)), is_causal: false }, NTH_VALUE(annotated_data_finite.inc_col,Int64(5)) ORDER BY [annotated_data_finite.ts ASC NULLS LAST] ROWS BETWEEN 10 PRECEDING AND 1 FOLLOWING: Ok(Field { name: "NTH_VALUE(annotated_data_finite.inc_col,Int64(5)) ORDER BY [annotated_data_finite.ts ASC NULLS LAST] ROWS BETWEEN 10 PRECEDING AND 1 FOLLOWING", data_type: Int32, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }), frame: WindowFrame { units: Rows, start_bound: Preceding(UInt64(10)), end_bound: Following(UInt64(1)), is_causal: false }, ROW_NUMBER() ORDER BY [annotated_data_finite.ts ASC NULLS LAST] RANGE BETWEEN 1 PRECEDING AND 10 FOLLOWING: Ok(Field { name: "ROW_NUMBER() ORDER BY [annotated_data_finite.ts ASC NULLS LAST] RANGE BETWEEN 1 PRECEDING AND 10 FOLLOWING", data_type: UInt64, nullable: false, dict_id: 0, dict_is_ordered: false, metadata: {} }), frame: WindowFrame { units: Range, start_bound: Preceding(Int32(1)), end_bound: Following(Int32(10)), is_causal: false }, ROW_NUMBER() ORDER BY [annotated_data_finite.ts ASC NULLS LAST] ROWS BETWEEN 10 PRECEDING AND 1 FOLLOWING: Ok(Field { name: "ROW_NUMBER() ORDER BY [annotated_data_finite.ts ASC NULLS LAST] ROWS BETWEEN 10 PRECEDING AND 1 FOLLOWING", data_type: UInt64, nullable: false, dict_id: 0, dict_is_ordered: false, metadata: {} }), frame: WindowFrame { units: Rows, start_bound: Preceding(UInt64(10)), end_bound: Following(UInt64(1)), is_causal: false }, RANK() ORDER BY [annotated_data_finite.ts ASC NULLS LAST] RANGE BETWEEN 1 PRECEDING AND 10 FOLLOWING: Ok(Field { name: "RANK() ORDER BY [annotated_data_finite.ts ASC NULLS LAST] RANGE BETWEEN 1 PRECEDING AND 10 FOLLOWING", data_type: UInt64, nullable: false, dict_id: 0, dict_is_ordered: false, metadata: {} }), frame: WindowFrame { units: Range, start_bound: Preceding(Int32(1)), end_bound: Following(Int32(10)), is_causal: false }, RANK() ORDER BY [annotated_data_finite.ts ASC NULLS LAST] ROWS BETWEEN 10 PRECEDING AND 1 FOLLOWING: Ok(Field { name: "RANK() ORDER BY [annotated_data_finite.ts ASC NULLS LAST] ROWS BETWEEN 10 PRECEDING AND 1 FOLLOWING", data_type: UInt64, nullable: false, dict_id: 0, dict_is_ordered: false, metadata: {} }), frame: WindowFrame { units: Rows, start_bound: Preceding(UInt64(10)), end_bound: Following(UInt64(1)), is_causal: false }, DENSE_RANK() ORDER BY [annotated_data_finite.ts ASC NULLS LAST] RANGE BETWEEN 1 PRECEDING AND 10 FOLLOWING: Ok(Field { name: "DENSE_RANK() ORDER BY [annotated_data_finite.ts ASC NULLS LAST] RANGE BETWEEN 1 PRECEDING AND 10 FOLLOWING", data_type: UInt64, nullable: false, dict_id: 0, dict_is_ordered: false, metadata: {} }), frame: WindowFrame { units: Range, start_bound: Preceding(Int32(1)), end_bound: Following(Int32(10)), is_causal: false }, DENSE_RANK() ORDER BY [annotated_data_finite.ts ASC NULLS LAST] ROWS BETWEEN 10 PRECEDING AND 1 FOLLOWING: Ok(Field { name: "DENSE_RANK() ORDER BY [annotated_data_finite.ts ASC NULLS LAST] ROWS BETWEEN 10 PRECEDING AND 1 FOLLOWING", data_type: UInt64, nullable: false, dict_id: 0, dict_is_ordered: false, metadata: {} }), frame: WindowFrame { units: Rows, start_bound: Preceding(UInt64(10)), end_bound: Following(UInt64(1)), is_causal: false }, LAG(annotated_data_finite.inc_col,Int64(1),Int64(1001)) ORDER BY [annotated_data_finite.ts ASC NULLS LAST] RANGE BETWEEN 1 PRECEDING AND 10 FOLLOWING: Ok(Field { name: "LAG(annotated_data_finite.inc_col,Int64(1),Int64(1001)) ORDER BY [annotated_data_finite.ts ASC NULLS LAST] RANGE BETWEEN 1 PRECEDING AND 10 FOLLOWING", data_type: Int32, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }), frame: WindowFrame { units: Range, start_bound: Preceding(Int32(1)), end_bound: Following(Int32(10)), is_causal: false }, LAG(annotated_data_finite.inc_col,Int64(2),Int64(1002)) ORDER BY [annotated_data_finite.ts ASC NULLS LAST] ROWS BETWEEN 10 PRECEDING AND 1 FOLLOWING: Ok(Field { name: "LAG(annotated_data_finite.inc_col,Int64(2),Int64(1002)) ORDER BY [annotated_data_finite.ts ASC NULLS LAST] ROWS BETWEEN 10 PRECEDING AND 1 FOLLOWING", data_type: Int32, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }), frame: WindowFrame { units: Rows, start_bound: Preceding(UInt64(10)), end_bound: Following(UInt64(1)), is_causal: false }, LEAD(annotated_data_finite.inc_col,Int64(-1),Int64(1001)) ORDER BY [annotated_data_finite.ts ASC NULLS LAST] RANGE BETWEEN 1 PRECEDING AND 10 FOLLOWING: Ok(Field { name: "LEAD(annotated_data_finite.inc_col,Int64(-1),Int64(1001)) ORDER BY [annotated_data_finite.ts ASC NULLS LAST] RANGE BETWEEN 1 PRECEDING AND 10 FOLLOWING", data_type: Int32, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }), frame: WindowFrame { units: Range, start_bound: Preceding(Int32(1)), end_bound: Following(Int32(10)), is_causal: false }, LEAD(annotated_data_finite.inc_col,Int64(4),Int64(1004)) ORDER BY [annotated_data_finite.ts ASC NULLS LAST] ROWS BETWEEN 10 PRECEDING AND 1 FOLLOWING: Ok(Field { name: "LEAD(annotated_data_finite.inc_col,Int64(4),Int64(1004)) ORDER BY [annotated_data_finite.ts ASC NULLS LAST] ROWS BETWEEN 10 PRECEDING AND 1 FOLLOWING", data_type: Int32, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }), frame: WindowFrame { units: Rows, start_bound: Preceding(UInt64(10)), end_bound: Following(UInt64(1)), is_causal: false }], mode=[Sorted] -05)--------BoundedWindowAggExec: wdw=[FIRST_VALUE(annotated_data_finite.inc_col) ORDER BY [annotated_data_finite.ts DESC NULLS FIRST] RANGE BETWEEN 10 PRECEDING AND 1 FOLLOWING: Ok(Field { name: "FIRST_VALUE(annotated_data_finite.inc_col) ORDER BY [annotated_data_finite.ts DESC NULLS FIRST] RANGE BETWEEN 10 PRECEDING AND 1 FOLLOWING", data_type: Int32, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }), frame: WindowFrame { units: Range, start_bound: Preceding(Int32(1)), end_bound: Following(Int32(10)), is_causal: false }, FIRST_VALUE(annotated_data_finite.inc_col) ORDER BY [annotated_data_finite.ts DESC NULLS FIRST] ROWS BETWEEN 10 PRECEDING AND 1 FOLLOWING: Ok(Field { name: "FIRST_VALUE(annotated_data_finite.inc_col) ORDER BY [annotated_data_finite.ts DESC NULLS FIRST] ROWS BETWEEN 10 PRECEDING AND 1 FOLLOWING", data_type: Int32, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }), frame: WindowFrame { units: Rows, start_bound: Preceding(UInt64(1)), end_bound: Following(UInt64(10)), is_causal: false }, LAST_VALUE(annotated_data_finite.inc_col) ORDER BY [annotated_data_finite.ts DESC NULLS FIRST] RANGE BETWEEN 10 PRECEDING AND 1 FOLLOWING: Ok(Field { name: "LAST_VALUE(annotated_data_finite.inc_col) ORDER BY [annotated_data_finite.ts DESC NULLS FIRST] RANGE BETWEEN 10 PRECEDING AND 1 FOLLOWING", data_type: Int32, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }), frame: WindowFrame { units: Range, start_bound: Preceding(Int32(1)), end_bound: Following(Int32(10)), is_causal: false }, LAST_VALUE(annotated_data_finite.inc_col) ORDER BY [annotated_data_finite.ts DESC NULLS FIRST] ROWS BETWEEN 10 PRECEDING AND 1 FOLLOWING: Ok(Field { name: "LAST_VALUE(annotated_data_finite.inc_col) ORDER BY [annotated_data_finite.ts DESC NULLS FIRST] ROWS BETWEEN 10 PRECEDING AND 1 FOLLOWING", data_type: Int32, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }), frame: WindowFrame { units: Rows, start_bound: Preceding(UInt64(1)), end_bound: Following(UInt64(10)), is_causal: false }, LAG(annotated_data_finite.inc_col,Int64(1),Int64(1001)) ORDER BY [annotated_data_finite.ts DESC NULLS FIRST] RANGE BETWEEN 1 PRECEDING AND 10 FOLLOWING: Ok(Field { name: "LAG(annotated_data_finite.inc_col,Int64(1),Int64(1001)) ORDER BY [annotated_data_finite.ts DESC NULLS FIRST] RANGE BETWEEN 1 PRECEDING AND 10 FOLLOWING", data_type: Int32, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }), frame: WindowFrame { units: Range, start_bound: Preceding(Int32(10)), end_bound: Following(Int32(1)), is_causal: false }, LAG(annotated_data_finite.inc_col,Int64(2),Int64(1002)) ORDER BY [annotated_data_finite.ts DESC NULLS FIRST] ROWS BETWEEN 10 PRECEDING AND 1 FOLLOWING: Ok(Field { name: "LAG(annotated_data_finite.inc_col,Int64(2),Int64(1002)) ORDER BY [annotated_data_finite.ts DESC NULLS FIRST] ROWS BETWEEN 10 PRECEDING AND 1 FOLLOWING", data_type: Int32, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }), frame: WindowFrame { units: Rows, start_bound: Preceding(UInt64(1)), end_bound: Following(UInt64(10)), is_causal: false }, LEAD(annotated_data_finite.inc_col,Int64(-1),Int64(1001)) ORDER BY [annotated_data_finite.ts DESC NULLS FIRST] RANGE BETWEEN 1 PRECEDING AND 10 FOLLOWING: Ok(Field { name: "LEAD(annotated_data_finite.inc_col,Int64(-1),Int64(1001)) ORDER BY [annotated_data_finite.ts DESC NULLS FIRST] RANGE BETWEEN 1 PRECEDING AND 10 FOLLOWING", data_type: Int32, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }), frame: WindowFrame { units: Range, start_bound: Preceding(Int32(10)), end_bound: Following(Int32(1)), is_causal: false }, LEAD(annotated_data_finite.inc_col,Int64(4),Int64(1004)) ORDER BY [annotated_data_finite.ts DESC NULLS FIRST] ROWS BETWEEN 10 PRECEDING AND 1 FOLLOWING: Ok(Field { name: "LEAD(annotated_data_finite.inc_col,Int64(4),Int64(1004)) ORDER BY [annotated_data_finite.ts DESC NULLS FIRST] ROWS BETWEEN 10 PRECEDING AND 1 FOLLOWING", data_type: Int32, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }), frame: WindowFrame { units: Rows, start_bound: Preceding(UInt64(1)), end_bound: Following(UInt64(10)), is_causal: false }], mode=[Sorted] +03)----ProjectionExec: expr=[ts@0 as ts, FIRST_VALUE(annotated_data_finite.inc_col) ORDER BY [annotated_data_finite.ts ASC NULLS LAST] RANGE BETWEEN 10 PRECEDING AND 1 FOLLOWING@10 as fv1, FIRST_VALUE(annotated_data_finite.inc_col) ORDER BY [annotated_data_finite.ts ASC NULLS LAST] ROWS BETWEEN 10 PRECEDING AND 1 FOLLOWING@11 as fv2, LAST_VALUE(annotated_data_finite.inc_col) ORDER BY [annotated_data_finite.ts ASC NULLS LAST] RANGE BETWEEN 10 PRECEDING AND 1 FOLLOWING@12 as lv1, LAST_VALUE(annotated_data_finite.inc_col) ORDER BY [annotated_data_finite.ts ASC NULLS LAST] ROWS BETWEEN 10 PRECEDING AND 1 FOLLOWING@13 as lv2, NTH_VALUE(annotated_data_finite.inc_col, Int64(5)) ORDER BY [annotated_data_finite.ts ASC NULLS LAST] RANGE BETWEEN 10 PRECEDING AND 1 FOLLOWING@14 as nv1, NTH_VALUE(annotated_data_finite.inc_col, Int64(5)) ORDER BY [annotated_data_finite.ts ASC NULLS LAST] ROWS BETWEEN 10 PRECEDING AND 1 FOLLOWING@15 as nv2, ROW_NUMBER() ORDER BY [annotated_data_finite.ts ASC NULLS LAST] RANGE BETWEEN 1 PRECEDING AND 10 FOLLOWING@16 as rn1, ROW_NUMBER() ORDER BY [annotated_data_finite.ts ASC NULLS LAST] ROWS BETWEEN 10 PRECEDING AND 1 FOLLOWING@17 as rn2, RANK() ORDER BY [annotated_data_finite.ts ASC NULLS LAST] RANGE BETWEEN 1 PRECEDING AND 10 FOLLOWING@18 as rank1, RANK() ORDER BY [annotated_data_finite.ts ASC NULLS LAST] ROWS BETWEEN 10 PRECEDING AND 1 FOLLOWING@19 as rank2, DENSE_RANK() ORDER BY [annotated_data_finite.ts ASC NULLS LAST] RANGE BETWEEN 1 PRECEDING AND 10 FOLLOWING@20 as dense_rank1, DENSE_RANK() ORDER BY [annotated_data_finite.ts ASC NULLS LAST] ROWS BETWEEN 10 PRECEDING AND 1 FOLLOWING@21 as dense_rank2, LAG(annotated_data_finite.inc_col, Int64(1), Int64(1001)) ORDER BY [annotated_data_finite.ts ASC NULLS LAST] RANGE BETWEEN 1 PRECEDING AND 10 FOLLOWING@22 as lag1, LAG(annotated_data_finite.inc_col, Int64(2), Int64(1002)) ORDER BY [annotated_data_finite.ts ASC NULLS LAST] ROWS BETWEEN 10 PRECEDING AND 1 FOLLOWING@23 as lag2, LEAD(annotated_data_finite.inc_col, Int64(-1), Int64(1001)) ORDER BY [annotated_data_finite.ts ASC NULLS LAST] RANGE BETWEEN 1 PRECEDING AND 10 FOLLOWING@24 as lead1, LEAD(annotated_data_finite.inc_col, Int64(4), Int64(1004)) ORDER BY [annotated_data_finite.ts ASC NULLS LAST] ROWS BETWEEN 10 PRECEDING AND 1 FOLLOWING@25 as lead2, FIRST_VALUE(annotated_data_finite.inc_col) ORDER BY [annotated_data_finite.ts DESC NULLS FIRST] RANGE BETWEEN 10 PRECEDING AND 1 FOLLOWING@2 as fvr1, FIRST_VALUE(annotated_data_finite.inc_col) ORDER BY [annotated_data_finite.ts DESC NULLS FIRST] ROWS BETWEEN 10 PRECEDING AND 1 FOLLOWING@3 as fvr2, LAST_VALUE(annotated_data_finite.inc_col) ORDER BY [annotated_data_finite.ts DESC NULLS FIRST] RANGE BETWEEN 10 PRECEDING AND 1 FOLLOWING@4 as lvr1, LAST_VALUE(annotated_data_finite.inc_col) ORDER BY [annotated_data_finite.ts DESC NULLS FIRST] ROWS BETWEEN 10 PRECEDING AND 1 FOLLOWING@5 as lvr2, LAG(annotated_data_finite.inc_col, Int64(1), Int64(1001)) ORDER BY [annotated_data_finite.ts DESC NULLS FIRST] RANGE BETWEEN 1 PRECEDING AND 10 FOLLOWING@6 as lagr1, LAG(annotated_data_finite.inc_col, Int64(2), Int64(1002)) ORDER BY [annotated_data_finite.ts DESC NULLS FIRST] ROWS BETWEEN 10 PRECEDING AND 1 FOLLOWING@7 as lagr2, LEAD(annotated_data_finite.inc_col, Int64(-1), Int64(1001)) ORDER BY [annotated_data_finite.ts DESC NULLS FIRST] RANGE BETWEEN 1 PRECEDING AND 10 FOLLOWING@8 as leadr1, LEAD(annotated_data_finite.inc_col, Int64(4), Int64(1004)) ORDER BY [annotated_data_finite.ts DESC NULLS FIRST] ROWS BETWEEN 10 PRECEDING AND 1 FOLLOWING@9 as leadr2] +04)------BoundedWindowAggExec: wdw=[FIRST_VALUE(annotated_data_finite.inc_col) ORDER BY [annotated_data_finite.ts ASC NULLS LAST] RANGE BETWEEN 10 PRECEDING AND 1 FOLLOWING: Ok(Field { name: "FIRST_VALUE(annotated_data_finite.inc_col) ORDER BY [annotated_data_finite.ts ASC NULLS LAST] RANGE BETWEEN 10 PRECEDING AND 1 FOLLOWING", data_type: Int32, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }), frame: WindowFrame { units: Range, start_bound: Preceding(Int32(10)), end_bound: Following(Int32(1)), is_causal: false }, FIRST_VALUE(annotated_data_finite.inc_col) ORDER BY [annotated_data_finite.ts ASC NULLS LAST] ROWS BETWEEN 10 PRECEDING AND 1 FOLLOWING: Ok(Field { name: "FIRST_VALUE(annotated_data_finite.inc_col) ORDER BY [annotated_data_finite.ts ASC NULLS LAST] ROWS BETWEEN 10 PRECEDING AND 1 FOLLOWING", data_type: Int32, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }), frame: WindowFrame { units: Rows, start_bound: Preceding(UInt64(10)), end_bound: Following(UInt64(1)), is_causal: false }, LAST_VALUE(annotated_data_finite.inc_col) ORDER BY [annotated_data_finite.ts ASC NULLS LAST] RANGE BETWEEN 10 PRECEDING AND 1 FOLLOWING: Ok(Field { name: "LAST_VALUE(annotated_data_finite.inc_col) ORDER BY [annotated_data_finite.ts ASC NULLS LAST] RANGE BETWEEN 10 PRECEDING AND 1 FOLLOWING", data_type: Int32, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }), frame: WindowFrame { units: Range, start_bound: Preceding(Int32(10)), end_bound: Following(Int32(1)), is_causal: false }, LAST_VALUE(annotated_data_finite.inc_col) ORDER BY [annotated_data_finite.ts ASC NULLS LAST] ROWS BETWEEN 10 PRECEDING AND 1 FOLLOWING: Ok(Field { name: "LAST_VALUE(annotated_data_finite.inc_col) ORDER BY [annotated_data_finite.ts ASC NULLS LAST] ROWS BETWEEN 10 PRECEDING AND 1 FOLLOWING", data_type: Int32, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }), frame: WindowFrame { units: Rows, start_bound: Preceding(UInt64(10)), end_bound: Following(UInt64(1)), is_causal: false }, NTH_VALUE(annotated_data_finite.inc_col, Int64(5)) ORDER BY [annotated_data_finite.ts ASC NULLS LAST] RANGE BETWEEN 10 PRECEDING AND 1 FOLLOWING: Ok(Field { name: "NTH_VALUE(annotated_data_finite.inc_col, Int64(5)) ORDER BY [annotated_data_finite.ts ASC NULLS LAST] RANGE BETWEEN 10 PRECEDING AND 1 FOLLOWING", data_type: Int32, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }), frame: WindowFrame { units: Range, start_bound: Preceding(Int32(10)), end_bound: Following(Int32(1)), is_causal: false }, NTH_VALUE(annotated_data_finite.inc_col, Int64(5)) ORDER BY [annotated_data_finite.ts ASC NULLS LAST] ROWS BETWEEN 10 PRECEDING AND 1 FOLLOWING: Ok(Field { name: "NTH_VALUE(annotated_data_finite.inc_col, Int64(5)) ORDER BY [annotated_data_finite.ts ASC NULLS LAST] ROWS BETWEEN 10 PRECEDING AND 1 FOLLOWING", data_type: Int32, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }), frame: WindowFrame { units: Rows, start_bound: Preceding(UInt64(10)), end_bound: Following(UInt64(1)), is_causal: false }, ROW_NUMBER() ORDER BY [annotated_data_finite.ts ASC NULLS LAST] RANGE BETWEEN 1 PRECEDING AND 10 FOLLOWING: Ok(Field { name: "ROW_NUMBER() ORDER BY [annotated_data_finite.ts ASC NULLS LAST] RANGE BETWEEN 1 PRECEDING AND 10 FOLLOWING", data_type: UInt64, nullable: false, dict_id: 0, dict_is_ordered: false, metadata: {} }), frame: WindowFrame { units: Range, start_bound: Preceding(Int32(1)), end_bound: Following(Int32(10)), is_causal: false }, ROW_NUMBER() ORDER BY [annotated_data_finite.ts ASC NULLS LAST] ROWS BETWEEN 10 PRECEDING AND 1 FOLLOWING: Ok(Field { name: "ROW_NUMBER() ORDER BY [annotated_data_finite.ts ASC NULLS LAST] ROWS BETWEEN 10 PRECEDING AND 1 FOLLOWING", data_type: UInt64, nullable: false, dict_id: 0, dict_is_ordered: false, metadata: {} }), frame: WindowFrame { units: Rows, start_bound: Preceding(UInt64(10)), end_bound: Following(UInt64(1)), is_causal: false }, RANK() ORDER BY [annotated_data_finite.ts ASC NULLS LAST] RANGE BETWEEN 1 PRECEDING AND 10 FOLLOWING: Ok(Field { name: "RANK() ORDER BY [annotated_data_finite.ts ASC NULLS LAST] RANGE BETWEEN 1 PRECEDING AND 10 FOLLOWING", data_type: UInt64, nullable: false, dict_id: 0, dict_is_ordered: false, metadata: {} }), frame: WindowFrame { units: Range, start_bound: Preceding(Int32(1)), end_bound: Following(Int32(10)), is_causal: false }, RANK() ORDER BY [annotated_data_finite.ts ASC NULLS LAST] ROWS BETWEEN 10 PRECEDING AND 1 FOLLOWING: Ok(Field { name: "RANK() ORDER BY [annotated_data_finite.ts ASC NULLS LAST] ROWS BETWEEN 10 PRECEDING AND 1 FOLLOWING", data_type: UInt64, nullable: false, dict_id: 0, dict_is_ordered: false, metadata: {} }), frame: WindowFrame { units: Rows, start_bound: Preceding(UInt64(10)), end_bound: Following(UInt64(1)), is_causal: false }, DENSE_RANK() ORDER BY [annotated_data_finite.ts ASC NULLS LAST] RANGE BETWEEN 1 PRECEDING AND 10 FOLLOWING: Ok(Field { name: "DENSE_RANK() ORDER BY [annotated_data_finite.ts ASC NULLS LAST] RANGE BETWEEN 1 PRECEDING AND 10 FOLLOWING", data_type: UInt64, nullable: false, dict_id: 0, dict_is_ordered: false, metadata: {} }), frame: WindowFrame { units: Range, start_bound: Preceding(Int32(1)), end_bound: Following(Int32(10)), is_causal: false }, DENSE_RANK() ORDER BY [annotated_data_finite.ts ASC NULLS LAST] ROWS BETWEEN 10 PRECEDING AND 1 FOLLOWING: Ok(Field { name: "DENSE_RANK() ORDER BY [annotated_data_finite.ts ASC NULLS LAST] ROWS BETWEEN 10 PRECEDING AND 1 FOLLOWING", data_type: UInt64, nullable: false, dict_id: 0, dict_is_ordered: false, metadata: {} }), frame: WindowFrame { units: Rows, start_bound: Preceding(UInt64(10)), end_bound: Following(UInt64(1)), is_causal: false }, LAG(annotated_data_finite.inc_col, Int64(1), Int64(1001)) ORDER BY [annotated_data_finite.ts ASC NULLS LAST] RANGE BETWEEN 1 PRECEDING AND 10 FOLLOWING: Ok(Field { name: "LAG(annotated_data_finite.inc_col, Int64(1), Int64(1001)) ORDER BY [annotated_data_finite.ts ASC NULLS LAST] RANGE BETWEEN 1 PRECEDING AND 10 FOLLOWING", data_type: Int32, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }), frame: WindowFrame { units: Range, start_bound: Preceding(Int32(1)), end_bound: Following(Int32(10)), is_causal: false }, LAG(annotated_data_finite.inc_col, Int64(2), Int64(1002)) ORDER BY [annotated_data_finite.ts ASC NULLS LAST] ROWS BETWEEN 10 PRECEDING AND 1 FOLLOWING: Ok(Field { name: "LAG(annotated_data_finite.inc_col, Int64(2), Int64(1002)) ORDER BY [annotated_data_finite.ts ASC NULLS LAST] ROWS BETWEEN 10 PRECEDING AND 1 FOLLOWING", data_type: Int32, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }), frame: WindowFrame { units: Rows, start_bound: Preceding(UInt64(10)), end_bound: Following(UInt64(1)), is_causal: false }, LEAD(annotated_data_finite.inc_col, Int64(-1), Int64(1001)) ORDER BY [annotated_data_finite.ts ASC NULLS LAST] RANGE BETWEEN 1 PRECEDING AND 10 FOLLOWING: Ok(Field { name: "LEAD(annotated_data_finite.inc_col, Int64(-1), Int64(1001)) ORDER BY [annotated_data_finite.ts ASC NULLS LAST] RANGE BETWEEN 1 PRECEDING AND 10 FOLLOWING", data_type: Int32, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }), frame: WindowFrame { units: Range, start_bound: Preceding(Int32(1)), end_bound: Following(Int32(10)), is_causal: false }, LEAD(annotated_data_finite.inc_col, Int64(4), Int64(1004)) ORDER BY [annotated_data_finite.ts ASC NULLS LAST] ROWS BETWEEN 10 PRECEDING AND 1 FOLLOWING: Ok(Field { name: "LEAD(annotated_data_finite.inc_col, Int64(4), Int64(1004)) ORDER BY [annotated_data_finite.ts ASC NULLS LAST] ROWS BETWEEN 10 PRECEDING AND 1 FOLLOWING", data_type: Int32, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }), frame: WindowFrame { units: Rows, start_bound: Preceding(UInt64(10)), end_bound: Following(UInt64(1)), is_causal: false }], mode=[Sorted] +05)--------BoundedWindowAggExec: wdw=[FIRST_VALUE(annotated_data_finite.inc_col) ORDER BY [annotated_data_finite.ts DESC NULLS FIRST] RANGE BETWEEN 10 PRECEDING AND 1 FOLLOWING: Ok(Field { name: "FIRST_VALUE(annotated_data_finite.inc_col) ORDER BY [annotated_data_finite.ts DESC NULLS FIRST] RANGE BETWEEN 10 PRECEDING AND 1 FOLLOWING", data_type: Int32, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }), frame: WindowFrame { units: Range, start_bound: Preceding(Int32(1)), end_bound: Following(Int32(10)), is_causal: false }, FIRST_VALUE(annotated_data_finite.inc_col) ORDER BY [annotated_data_finite.ts DESC NULLS FIRST] ROWS BETWEEN 10 PRECEDING AND 1 FOLLOWING: Ok(Field { name: "FIRST_VALUE(annotated_data_finite.inc_col) ORDER BY [annotated_data_finite.ts DESC NULLS FIRST] ROWS BETWEEN 10 PRECEDING AND 1 FOLLOWING", data_type: Int32, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }), frame: WindowFrame { units: Rows, start_bound: Preceding(UInt64(1)), end_bound: Following(UInt64(10)), is_causal: false }, LAST_VALUE(annotated_data_finite.inc_col) ORDER BY [annotated_data_finite.ts DESC NULLS FIRST] RANGE BETWEEN 10 PRECEDING AND 1 FOLLOWING: Ok(Field { name: "LAST_VALUE(annotated_data_finite.inc_col) ORDER BY [annotated_data_finite.ts DESC NULLS FIRST] RANGE BETWEEN 10 PRECEDING AND 1 FOLLOWING", data_type: Int32, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }), frame: WindowFrame { units: Range, start_bound: Preceding(Int32(1)), end_bound: Following(Int32(10)), is_causal: false }, LAST_VALUE(annotated_data_finite.inc_col) ORDER BY [annotated_data_finite.ts DESC NULLS FIRST] ROWS BETWEEN 10 PRECEDING AND 1 FOLLOWING: Ok(Field { name: "LAST_VALUE(annotated_data_finite.inc_col) ORDER BY [annotated_data_finite.ts DESC NULLS FIRST] ROWS BETWEEN 10 PRECEDING AND 1 FOLLOWING", data_type: Int32, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }), frame: WindowFrame { units: Rows, start_bound: Preceding(UInt64(1)), end_bound: Following(UInt64(10)), is_causal: false }, LAG(annotated_data_finite.inc_col, Int64(1), Int64(1001)) ORDER BY [annotated_data_finite.ts DESC NULLS FIRST] RANGE BETWEEN 1 PRECEDING AND 10 FOLLOWING: Ok(Field { name: "LAG(annotated_data_finite.inc_col, Int64(1), Int64(1001)) ORDER BY [annotated_data_finite.ts DESC NULLS FIRST] RANGE BETWEEN 1 PRECEDING AND 10 FOLLOWING", data_type: Int32, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }), frame: WindowFrame { units: Range, start_bound: Preceding(Int32(10)), end_bound: Following(Int32(1)), is_causal: false }, LAG(annotated_data_finite.inc_col, Int64(2), Int64(1002)) ORDER BY [annotated_data_finite.ts DESC NULLS FIRST] ROWS BETWEEN 10 PRECEDING AND 1 FOLLOWING: Ok(Field { name: "LAG(annotated_data_finite.inc_col, Int64(2), Int64(1002)) ORDER BY [annotated_data_finite.ts DESC NULLS FIRST] ROWS BETWEEN 10 PRECEDING AND 1 FOLLOWING", data_type: Int32, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }), frame: WindowFrame { units: Rows, start_bound: Preceding(UInt64(1)), end_bound: Following(UInt64(10)), is_causal: false }, LEAD(annotated_data_finite.inc_col, Int64(-1), Int64(1001)) ORDER BY [annotated_data_finite.ts DESC NULLS FIRST] RANGE BETWEEN 1 PRECEDING AND 10 FOLLOWING: Ok(Field { name: "LEAD(annotated_data_finite.inc_col, Int64(-1), Int64(1001)) ORDER BY [annotated_data_finite.ts DESC NULLS FIRST] RANGE BETWEEN 1 PRECEDING AND 10 FOLLOWING", data_type: Int32, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }), frame: WindowFrame { units: Range, start_bound: Preceding(Int32(10)), end_bound: Following(Int32(1)), is_causal: false }, LEAD(annotated_data_finite.inc_col, Int64(4), Int64(1004)) ORDER BY [annotated_data_finite.ts DESC NULLS FIRST] ROWS BETWEEN 10 PRECEDING AND 1 FOLLOWING: Ok(Field { name: "LEAD(annotated_data_finite.inc_col, Int64(4), Int64(1004)) ORDER BY [annotated_data_finite.ts DESC NULLS FIRST] ROWS BETWEEN 10 PRECEDING AND 1 FOLLOWING", data_type: Int32, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }), frame: WindowFrame { units: Rows, start_bound: Preceding(UInt64(1)), end_bound: Following(UInt64(10)), is_causal: false }], mode=[Sorted] 06)----------CsvExec: file_groups={1 group: [[WORKSPACE_ROOT/datafusion/core/tests/data/window_1.csv]]}, projection=[ts, inc_col], output_ordering=[ts@0 ASC NULLS LAST], has_header=true query IIIIIIIIIIIIIIIIIIIIIIIII @@ -2762,7 +2762,7 @@ logical_plan 01)Projection: first_value1, first_value2, last_value1, last_value2, nth_value1 02)--Limit: skip=0, fetch=5 03)----Sort: annotated_data_finite.inc_col ASC NULLS LAST, fetch=5 -04)------Projection: FIRST_VALUE(annotated_data_finite.inc_col) ORDER BY [annotated_data_finite.ts ASC NULLS LAST] ROWS BETWEEN UNBOUNDED PRECEDING AND 1 FOLLOWING AS first_value1, FIRST_VALUE(annotated_data_finite.inc_col) ORDER BY [annotated_data_finite.ts DESC NULLS FIRST] ROWS BETWEEN 3 PRECEDING AND UNBOUNDED FOLLOWING AS first_value2, LAST_VALUE(annotated_data_finite.inc_col) ORDER BY [annotated_data_finite.ts ASC NULLS LAST] ROWS BETWEEN UNBOUNDED PRECEDING AND 1 FOLLOWING AS last_value1, LAST_VALUE(annotated_data_finite.inc_col) ORDER BY [annotated_data_finite.ts DESC NULLS FIRST] ROWS BETWEEN 3 PRECEDING AND UNBOUNDED FOLLOWING AS last_value2, NTH_VALUE(annotated_data_finite.inc_col,Int64(2)) ORDER BY [annotated_data_finite.ts ASC NULLS LAST] ROWS BETWEEN UNBOUNDED PRECEDING AND 1 FOLLOWING AS nth_value1, annotated_data_finite.inc_col +04)------Projection: FIRST_VALUE(annotated_data_finite.inc_col) ORDER BY [annotated_data_finite.ts ASC NULLS LAST] ROWS BETWEEN UNBOUNDED PRECEDING AND 1 FOLLOWING AS first_value1, FIRST_VALUE(annotated_data_finite.inc_col) ORDER BY [annotated_data_finite.ts DESC NULLS FIRST] ROWS BETWEEN 3 PRECEDING AND UNBOUNDED FOLLOWING AS first_value2, LAST_VALUE(annotated_data_finite.inc_col) ORDER BY [annotated_data_finite.ts ASC NULLS LAST] ROWS BETWEEN UNBOUNDED PRECEDING AND 1 FOLLOWING AS last_value1, LAST_VALUE(annotated_data_finite.inc_col) ORDER BY [annotated_data_finite.ts DESC NULLS FIRST] ROWS BETWEEN 3 PRECEDING AND UNBOUNDED FOLLOWING AS last_value2, NTH_VALUE(annotated_data_finite.inc_col, Int64(2)) ORDER BY [annotated_data_finite.ts ASC NULLS LAST] ROWS BETWEEN UNBOUNDED PRECEDING AND 1 FOLLOWING AS nth_value1, annotated_data_finite.inc_col 05)--------WindowAggr: windowExpr=[[FIRST_VALUE(annotated_data_finite.inc_col) ORDER BY [annotated_data_finite.ts ASC NULLS LAST] ROWS BETWEEN UNBOUNDED PRECEDING AND 1 FOLLOWING, LAST_VALUE(annotated_data_finite.inc_col) ORDER BY [annotated_data_finite.ts ASC NULLS LAST] ROWS BETWEEN UNBOUNDED PRECEDING AND 1 FOLLOWING, NTH_VALUE(annotated_data_finite.inc_col, Int64(2)) ORDER BY [annotated_data_finite.ts ASC NULLS LAST] ROWS BETWEEN UNBOUNDED PRECEDING AND 1 FOLLOWING]] 06)----------WindowAggr: windowExpr=[[FIRST_VALUE(annotated_data_finite.inc_col) ORDER BY [annotated_data_finite.ts DESC NULLS FIRST] ROWS BETWEEN 3 PRECEDING AND UNBOUNDED FOLLOWING, LAST_VALUE(annotated_data_finite.inc_col) ORDER BY [annotated_data_finite.ts DESC NULLS FIRST] ROWS BETWEEN 3 PRECEDING AND UNBOUNDED FOLLOWING]] 07)------------TableScan: annotated_data_finite projection=[ts, inc_col] @@ -2770,8 +2770,8 @@ physical_plan 01)ProjectionExec: expr=[first_value1@0 as first_value1, first_value2@1 as first_value2, last_value1@2 as last_value1, last_value2@3 as last_value2, nth_value1@4 as nth_value1] 02)--GlobalLimitExec: skip=0, fetch=5 03)----SortExec: TopK(fetch=5), expr=[inc_col@5 ASC NULLS LAST], preserve_partitioning=[false] -04)------ProjectionExec: expr=[FIRST_VALUE(annotated_data_finite.inc_col) ORDER BY [annotated_data_finite.ts ASC NULLS LAST] ROWS BETWEEN UNBOUNDED PRECEDING AND 1 FOLLOWING@4 as first_value1, FIRST_VALUE(annotated_data_finite.inc_col) ORDER BY [annotated_data_finite.ts DESC NULLS FIRST] ROWS BETWEEN 3 PRECEDING AND UNBOUNDED FOLLOWING@2 as first_value2, LAST_VALUE(annotated_data_finite.inc_col) ORDER BY [annotated_data_finite.ts ASC NULLS LAST] ROWS BETWEEN UNBOUNDED PRECEDING AND 1 FOLLOWING@5 as last_value1, LAST_VALUE(annotated_data_finite.inc_col) ORDER BY [annotated_data_finite.ts DESC NULLS FIRST] ROWS BETWEEN 3 PRECEDING AND UNBOUNDED FOLLOWING@3 as last_value2, NTH_VALUE(annotated_data_finite.inc_col,Int64(2)) ORDER BY [annotated_data_finite.ts ASC NULLS LAST] ROWS BETWEEN UNBOUNDED PRECEDING AND 1 FOLLOWING@6 as nth_value1, inc_col@1 as inc_col] -05)--------BoundedWindowAggExec: wdw=[FIRST_VALUE(annotated_data_finite.inc_col) ORDER BY [annotated_data_finite.ts ASC NULLS LAST] ROWS BETWEEN UNBOUNDED PRECEDING AND 1 FOLLOWING: Ok(Field { name: "FIRST_VALUE(annotated_data_finite.inc_col) ORDER BY [annotated_data_finite.ts ASC NULLS LAST] ROWS BETWEEN UNBOUNDED PRECEDING AND 1 FOLLOWING", data_type: Int32, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }), frame: WindowFrame { units: Rows, start_bound: Preceding(UInt64(NULL)), end_bound: Following(UInt64(1)), is_causal: false }, LAST_VALUE(annotated_data_finite.inc_col) ORDER BY [annotated_data_finite.ts ASC NULLS LAST] ROWS BETWEEN UNBOUNDED PRECEDING AND 1 FOLLOWING: Ok(Field { name: "LAST_VALUE(annotated_data_finite.inc_col) ORDER BY [annotated_data_finite.ts ASC NULLS LAST] ROWS BETWEEN UNBOUNDED PRECEDING AND 1 FOLLOWING", data_type: Int32, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }), frame: WindowFrame { units: Rows, start_bound: Preceding(UInt64(NULL)), end_bound: Following(UInt64(1)), is_causal: false }, NTH_VALUE(annotated_data_finite.inc_col,Int64(2)) ORDER BY [annotated_data_finite.ts ASC NULLS LAST] ROWS BETWEEN UNBOUNDED PRECEDING AND 1 FOLLOWING: Ok(Field { name: "NTH_VALUE(annotated_data_finite.inc_col,Int64(2)) ORDER BY [annotated_data_finite.ts ASC NULLS LAST] ROWS BETWEEN UNBOUNDED PRECEDING AND 1 FOLLOWING", data_type: Int32, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }), frame: WindowFrame { units: Rows, start_bound: Preceding(UInt64(NULL)), end_bound: Following(UInt64(1)), is_causal: false }], mode=[Sorted] +04)------ProjectionExec: expr=[FIRST_VALUE(annotated_data_finite.inc_col) ORDER BY [annotated_data_finite.ts ASC NULLS LAST] ROWS BETWEEN UNBOUNDED PRECEDING AND 1 FOLLOWING@4 as first_value1, FIRST_VALUE(annotated_data_finite.inc_col) ORDER BY [annotated_data_finite.ts DESC NULLS FIRST] ROWS BETWEEN 3 PRECEDING AND UNBOUNDED FOLLOWING@2 as first_value2, LAST_VALUE(annotated_data_finite.inc_col) ORDER BY [annotated_data_finite.ts ASC NULLS LAST] ROWS BETWEEN UNBOUNDED PRECEDING AND 1 FOLLOWING@5 as last_value1, LAST_VALUE(annotated_data_finite.inc_col) ORDER BY [annotated_data_finite.ts DESC NULLS FIRST] ROWS BETWEEN 3 PRECEDING AND UNBOUNDED FOLLOWING@3 as last_value2, NTH_VALUE(annotated_data_finite.inc_col, Int64(2)) ORDER BY [annotated_data_finite.ts ASC NULLS LAST] ROWS BETWEEN UNBOUNDED PRECEDING AND 1 FOLLOWING@6 as nth_value1, inc_col@1 as inc_col] +05)--------BoundedWindowAggExec: wdw=[FIRST_VALUE(annotated_data_finite.inc_col) ORDER BY [annotated_data_finite.ts ASC NULLS LAST] ROWS BETWEEN UNBOUNDED PRECEDING AND 1 FOLLOWING: Ok(Field { name: "FIRST_VALUE(annotated_data_finite.inc_col) ORDER BY [annotated_data_finite.ts ASC NULLS LAST] ROWS BETWEEN UNBOUNDED PRECEDING AND 1 FOLLOWING", data_type: Int32, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }), frame: WindowFrame { units: Rows, start_bound: Preceding(UInt64(NULL)), end_bound: Following(UInt64(1)), is_causal: false }, LAST_VALUE(annotated_data_finite.inc_col) ORDER BY [annotated_data_finite.ts ASC NULLS LAST] ROWS BETWEEN UNBOUNDED PRECEDING AND 1 FOLLOWING: Ok(Field { name: "LAST_VALUE(annotated_data_finite.inc_col) ORDER BY [annotated_data_finite.ts ASC NULLS LAST] ROWS BETWEEN UNBOUNDED PRECEDING AND 1 FOLLOWING", data_type: Int32, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }), frame: WindowFrame { units: Rows, start_bound: Preceding(UInt64(NULL)), end_bound: Following(UInt64(1)), is_causal: false }, NTH_VALUE(annotated_data_finite.inc_col, Int64(2)) ORDER BY [annotated_data_finite.ts ASC NULLS LAST] ROWS BETWEEN UNBOUNDED PRECEDING AND 1 FOLLOWING: Ok(Field { name: "NTH_VALUE(annotated_data_finite.inc_col, Int64(2)) ORDER BY [annotated_data_finite.ts ASC NULLS LAST] ROWS BETWEEN UNBOUNDED PRECEDING AND 1 FOLLOWING", data_type: Int32, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }), frame: WindowFrame { units: Rows, start_bound: Preceding(UInt64(NULL)), end_bound: Following(UInt64(1)), is_causal: false }], mode=[Sorted] 06)----------BoundedWindowAggExec: wdw=[FIRST_VALUE(annotated_data_finite.inc_col) ORDER BY [annotated_data_finite.ts DESC NULLS FIRST] ROWS BETWEEN 3 PRECEDING AND UNBOUNDED FOLLOWING: Ok(Field { name: "FIRST_VALUE(annotated_data_finite.inc_col) ORDER BY [annotated_data_finite.ts DESC NULLS FIRST] ROWS BETWEEN 3 PRECEDING AND UNBOUNDED FOLLOWING", data_type: Int32, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }), frame: WindowFrame { units: Rows, start_bound: Preceding(UInt64(NULL)), end_bound: Following(UInt64(3)), is_causal: false }, LAST_VALUE(annotated_data_finite.inc_col) ORDER BY [annotated_data_finite.ts DESC NULLS FIRST] ROWS BETWEEN 3 PRECEDING AND UNBOUNDED FOLLOWING: Ok(Field { name: "LAST_VALUE(annotated_data_finite.inc_col) ORDER BY [annotated_data_finite.ts DESC NULLS FIRST] ROWS BETWEEN 3 PRECEDING AND UNBOUNDED FOLLOWING", data_type: Int32, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }), frame: WindowFrame { units: Rows, start_bound: Preceding(UInt64(NULL)), end_bound: Following(UInt64(3)), is_causal: false }], mode=[Sorted] 07)------------CsvExec: file_groups={1 group: [[WORKSPACE_ROOT/datafusion/core/tests/data/window_1.csv]]}, projection=[ts, inc_col], output_ordering=[ts@0 ASC NULLS LAST], has_header=true @@ -3559,13 +3559,13 @@ EXPLAIN SELECT c, NTH_VALUE(c, 2) OVER(order by c DESC) as nv1 logical_plan 01)Limit: skip=0, fetch=5 02)--Sort: multiple_ordered_table.c ASC NULLS LAST, fetch=5 -03)----Projection: multiple_ordered_table.c, NTH_VALUE(multiple_ordered_table.c,Int64(2)) ORDER BY [multiple_ordered_table.c DESC NULLS FIRST] RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW AS nv1 +03)----Projection: multiple_ordered_table.c, NTH_VALUE(multiple_ordered_table.c, Int64(2)) ORDER BY [multiple_ordered_table.c DESC NULLS FIRST] RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW AS nv1 04)------WindowAggr: windowExpr=[[NTH_VALUE(multiple_ordered_table.c, Int64(2)) ORDER BY [multiple_ordered_table.c DESC NULLS FIRST] RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW]] 05)--------TableScan: multiple_ordered_table projection=[c] physical_plan 01)GlobalLimitExec: skip=0, fetch=5 -02)--ProjectionExec: expr=[c@0 as c, NTH_VALUE(multiple_ordered_table.c,Int64(2)) ORDER BY [multiple_ordered_table.c DESC NULLS FIRST] RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW@1 as nv1] -03)----WindowAggExec: wdw=[NTH_VALUE(multiple_ordered_table.c,Int64(2)) ORDER BY [multiple_ordered_table.c DESC NULLS FIRST] RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW: Ok(Field { name: "NTH_VALUE(multiple_ordered_table.c,Int64(2)) ORDER BY [multiple_ordered_table.c DESC NULLS FIRST] RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW", data_type: Int32, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }), frame: WindowFrame { units: Range, start_bound: CurrentRow, end_bound: Following(Int32(NULL)), is_causal: false }] +02)--ProjectionExec: expr=[c@0 as c, NTH_VALUE(multiple_ordered_table.c, Int64(2)) ORDER BY [multiple_ordered_table.c DESC NULLS FIRST] RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW@1 as nv1] +03)----WindowAggExec: wdw=[NTH_VALUE(multiple_ordered_table.c, Int64(2)) ORDER BY [multiple_ordered_table.c DESC NULLS FIRST] RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW: Ok(Field { name: "NTH_VALUE(multiple_ordered_table.c, Int64(2)) ORDER BY [multiple_ordered_table.c DESC NULLS FIRST] RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW", data_type: Int32, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }), frame: WindowFrame { units: Range, start_bound: CurrentRow, end_bound: Following(Int32(NULL)), is_causal: false }] 04)------CsvExec: file_groups={1 group: [[WORKSPACE_ROOT/datafusion/core/tests/data/window_2.csv]]}, projection=[c], output_ordering=[c@0 ASC NULLS LAST], has_header=true query II From 8fd881713b2e487bf6adec7ebf3ef72c61425571 Mon Sep 17 00:00:00 2001 From: jayzhan211 Date: Fri, 3 May 2024 17:21:17 +0800 Subject: [PATCH 02/11] rename Signed-off-by: jayzhan211 --- datafusion/core/src/physical_planner.rs | 2 +- datafusion/expr/src/expr.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/datafusion/core/src/physical_planner.rs b/datafusion/core/src/physical_planner.rs index f6485dddce5b..d9d2f6015434 100644 --- a/datafusion/core/src/physical_planner.rs +++ b/datafusion/core/src/physical_planner.rs @@ -274,7 +274,7 @@ fn create_physical_name(e: &Expr, is_first_expr: bool) -> Result { .iter() .map(|e| create_physical_name(e, false)) .collect::>>()?; - Ok(format!("{}({})", fun.name(), names.join(","))) + Ok(format!("{}({})", fun.name(), names.join(", "))) } }, Expr::GroupingSet(grouping_set) => match grouping_set { diff --git a/datafusion/expr/src/expr.rs b/datafusion/expr/src/expr.rs index 6097e201603b..429251f7b5e5 100644 --- a/datafusion/expr/src/expr.rs +++ b/datafusion/expr/src/expr.rs @@ -1859,7 +1859,7 @@ pub(crate) fn create_name(e: &Expr) -> Result { AggregateFunctionDefinition::UDF(..) => { let names: Vec = args.iter().map(create_name).collect::>()?; - names.join(",") + names.join(", ") } }; let mut info = String::new(); From 0a0c40271ecbefff924e765b2ed95ab922eb7a7c Mon Sep 17 00:00:00 2001 From: jayzhan211 Date: Sun, 12 May 2024 09:29:08 +0800 Subject: [PATCH 03/11] apply snapshot Signed-off-by: jayzhan211 --- datafusion/common/src/test_util.rs | 16 +++ datafusion/core/Cargo.toml | 1 + .../tests/dataframe/dataframe_functions.rs | 120 +++++++++--------- ..._dataframe__dataframe_functions__cast.snap | 12 ++ ...taframe_functions__fn_array_to_string.snap | 12 ++ ...e__dataframe_functions__fn_arrow_cast.snap | 12 ++ ..._dataframe_functions__fn_arrow_typeof.snap | 12 ++ ...aframe__dataframe_functions__fn_ascii.snap | 9 ++ ...e__dataframe_functions__fn_bit_length.snap | 12 ++ ...aframe__dataframe_functions__fn_btrim.snap | 9 ++ ...aframe_functions__fn_btrim_with_chars.snap | 12 ++ ...aframe_functions__fn_character_length.snap | 12 ++ ...ataframe__dataframe_functions__fn_chr.snap | 9 ++ ...ame__dataframe_functions__fn_coalesce.snap | 12 ++ ...frame__dataframe_functions__fn_decode.snap | 12 ++ ...frame__dataframe_functions__fn_encode.snap | 12 ++ ...me__dataframe_functions__fn_ends_with.snap | 12 ++ ...rame__dataframe_functions__fn_initcap.snap | 12 ++ ...taframe__dataframe_functions__fn_left.snap | 12 ++ ...aframe__dataframe_functions__fn_lower.snap | 12 ++ ...taframe__dataframe_functions__fn_lpad.snap | 12 ++ ...aframe_functions__fn_lpad_with_string.snap | 12 ++ ...aframe__dataframe_functions__fn_ltrim.snap | 9 ++ ...rame_functions__fn_ltrim_with_columns.snap | 12 ++ ...ataframe__dataframe_functions__fn_md5.snap | 12 ++ ..._dataframe_functions__fn_named_struct.snap | 12 ++ ...frame__dataframe_functions__fn_nullif.snap | 12 ++ ...__dataframe_functions__fn_regexp_like.snap | 12 ++ ..._dataframe_functions__fn_regexp_match.snap | 12 ++ ...ataframe_functions__fn_regexp_replace.snap | 12 ++ ...frame__dataframe_functions__fn_repeat.snap | 12 ++ ...rame__dataframe_functions__fn_replace.snap | 12 ++ ...rame__dataframe_functions__fn_reverse.snap | 12 ++ ...aframe__dataframe_functions__fn_right.snap | 12 ++ ...taframe__dataframe_functions__fn_rpad.snap | 12 ++ ...me_functions__fn_rpad_with_characters.snap | 12 ++ ...frame__dataframe_functions__fn_sha224.snap | 12 ++ ...e__dataframe_functions__fn_split_part.snap | 12 ++ ...__dataframe_functions__fn_starts_with.snap | 12 ++ ...frame__dataframe_functions__fn_strpos.snap | 12 ++ ...frame__dataframe_functions__fn_struct.snap | 12 ++ ...frame__dataframe_functions__fn_substr.snap | 12 ++ ...frame__dataframe_functions__fn_to_hex.snap | 12 ++ ...me__dataframe_functions__fn_translate.snap | 12 ++ ...aframe__dataframe_functions__fn_upper.snap | 12 ++ ...__dataframe__dataframe_functions__nvl.snap | 12 ++ ..._dataframe__dataframe_functions__nvl2.snap | 12 ++ datafusion/expr/src/udf.rs | 2 +- 48 files changed, 595 insertions(+), 60 deletions(-) create mode 100644 datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__cast.snap create mode 100644 datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__fn_array_to_string.snap create mode 100644 datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__fn_arrow_cast.snap create mode 100644 datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__fn_arrow_typeof.snap create mode 100644 datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__fn_ascii.snap create mode 100644 datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__fn_bit_length.snap create mode 100644 datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__fn_btrim.snap create mode 100644 datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__fn_btrim_with_chars.snap create mode 100644 datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__fn_character_length.snap create mode 100644 datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__fn_chr.snap create mode 100644 datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__fn_coalesce.snap create mode 100644 datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__fn_decode.snap create mode 100644 datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__fn_encode.snap create mode 100644 datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__fn_ends_with.snap create mode 100644 datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__fn_initcap.snap create mode 100644 datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__fn_left.snap create mode 100644 datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__fn_lower.snap create mode 100644 datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__fn_lpad.snap create mode 100644 datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__fn_lpad_with_string.snap create mode 100644 datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__fn_ltrim.snap create mode 100644 datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__fn_ltrim_with_columns.snap create mode 100644 datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__fn_md5.snap create mode 100644 datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__fn_named_struct.snap create mode 100644 datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__fn_nullif.snap create mode 100644 datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__fn_regexp_like.snap create mode 100644 datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__fn_regexp_match.snap create mode 100644 datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__fn_regexp_replace.snap create mode 100644 datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__fn_repeat.snap create mode 100644 datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__fn_replace.snap create mode 100644 datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__fn_reverse.snap create mode 100644 datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__fn_right.snap create mode 100644 datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__fn_rpad.snap create mode 100644 datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__fn_rpad_with_characters.snap create mode 100644 datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__fn_sha224.snap create mode 100644 datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__fn_split_part.snap create mode 100644 datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__fn_starts_with.snap create mode 100644 datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__fn_strpos.snap create mode 100644 datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__fn_struct.snap create mode 100644 datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__fn_substr.snap create mode 100644 datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__fn_to_hex.snap create mode 100644 datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__fn_translate.snap create mode 100644 datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__fn_upper.snap create mode 100644 datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__nvl.snap create mode 100644 datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__nvl2.snap diff --git a/datafusion/common/src/test_util.rs b/datafusion/common/src/test_util.rs index 9c3dfe62e119..f395038aa06e 100644 --- a/datafusion/common/src/test_util.rs +++ b/datafusion/common/src/test_util.rs @@ -52,6 +52,22 @@ macro_rules! assert_batches_eq { }; } +#[macro_export] +macro_rules! assert_snapshot { + ($CHUNKS: expr) => { + let formatted = $crate::arrow::util::pretty::pretty_format_batches_with_options( + $CHUNKS, + &$crate::format::DEFAULT_FORMAT_OPTIONS, + ) + .unwrap() + .to_string(); + + let actual_lines: Vec<&str> = formatted.trim().lines().collect(); + + insta::assert_yaml_snapshot!(actual_lines); + }; +} + /// Compares formatted output of a record batch with an expected /// vector of strings in a way that order does not matter. /// This is a macro so errors appear on the correct line diff --git a/datafusion/core/Cargo.toml b/datafusion/core/Cargo.toml index 2bd552aacc44..aebc24d61de5 100644 --- a/datafusion/core/Cargo.toml +++ b/datafusion/core/Cargo.toml @@ -140,6 +140,7 @@ ctor = { workspace = true } doc-comment = { workspace = true } env_logger = { workspace = true } half = { workspace = true, default-features = true } +insta = { version = "1.38.0", features = ["yaml"] } paste = "^1.0" postgres-protocol = "0.6.4" postgres-types = { version = "0.2.4", features = ["derive", "with-chrono-0_4"] } diff --git a/datafusion/core/tests/dataframe/dataframe_functions.rs b/datafusion/core/tests/dataframe/dataframe_functions.rs index 2ffac6a775d7..62d69f617a79 100644 --- a/datafusion/core/tests/dataframe/dataframe_functions.rs +++ b/datafusion/core/tests/dataframe/dataframe_functions.rs @@ -76,18 +76,31 @@ async fn create_test_table() -> Result { /// Compares formatted output of a record batch with an expected /// vector of strings, using the assert_batch_eq! macro macro_rules! assert_fn_batches { - ($EXPR:expr, $EXPECTED: expr) => { - assert_fn_batches!($EXPR, $EXPECTED, 10) + ($EXPR:expr) => { + assert_fn_batches!($EXPR, 10) }; - ($EXPR:expr, $EXPECTED: expr, $LIMIT: expr) => { + ($EXPR:expr, $LIMIT: expr) => { let df = create_test_table().await?; let df = df.select(vec![$EXPR])?.limit(0, Some($LIMIT))?; let batches = df.collect().await?; - assert_batches_eq!($EXPECTED, &batches); + datafusion_common::assert_snapshot!(&batches); }; } +// macro_rules! assert_fn_batches { +// ($EXPR:expr, $EXPECTED: expr) => { +// assert_fn_batches!($EXPR, $EXPECTED, 10) +// }; +// ($EXPR:expr, $LIMIT: expr) => { +// let df = create_test_table().await?; +// let df = df.select(vec![$EXPR])?.limit(0, Some($LIMIT))?; +// let batches = df.collect().await?; + +// assert_batches_eq!($EXPECTED, &batches); +// }; +// } + #[tokio::test] async fn test_fn_ascii() -> Result<()> { let expr = ascii(col("a")); @@ -100,7 +113,7 @@ async fn test_fn_ascii() -> Result<()> { "+---------------+", ]; - assert_fn_batches!(expr, expected, 1); + assert_fn_batches!(expr, 1); Ok(()) } @@ -119,7 +132,7 @@ async fn test_fn_bit_length() -> Result<()> { "| 72 |", "+--------------------+", ]; - assert_fn_batches!(expr, expected); + assert_fn_batches!(expr); Ok(()) } @@ -136,7 +149,7 @@ async fn test_fn_btrim() -> Result<()> { "+-----------------------------------------+", ]; - assert_fn_batches!(expr, expected, 1); + assert_fn_batches!(expr, 1); Ok(()) } @@ -156,7 +169,7 @@ async fn test_fn_btrim_with_chars() -> Result<()> { "+--------------------------+", ]; - assert_fn_batches!(expr, expected); + assert_fn_batches!(expr); Ok(()) } @@ -176,7 +189,7 @@ async fn test_fn_nullif() -> Result<()> { "+-------------------------------+", ]; - assert_fn_batches!(expr, expected); + assert_fn_batches!(expr); Ok(()) } @@ -196,7 +209,7 @@ async fn test_fn_arrow_cast() -> Result<()> { "+--------------------------------------------------+", ]; - assert_fn_batches!(expr, expected); + assert_fn_batches!(expr); Ok(()) } @@ -224,7 +237,7 @@ async fn test_nvl() -> Result<()> { "+-------------+", ]; - assert_fn_batches!(expr, expected); + assert_fn_batches!(expr); Ok(()) } @@ -252,7 +265,7 @@ async fn test_nvl2() -> Result<()> { "+-------------+", ]; - assert_fn_batches!(expr, expected); + assert_fn_batches!(expr); Ok(()) } @@ -271,7 +284,7 @@ async fn test_fn_arrow_typeof() -> Result<()> { "+------------------------------------------------------------------------------------------------------------------+", ]; - assert_fn_batches!(expr, expected); + assert_fn_batches!(expr); Ok(()) } @@ -291,7 +304,7 @@ async fn test_fn_struct() -> Result<()> { "+--------------------------+", ]; - assert_fn_batches!(expr, expected); + assert_fn_batches!(expr); Ok(()) } @@ -311,7 +324,7 @@ async fn test_fn_named_struct() -> Result<()> { "+---------------------------------------------------------------+", ]; - assert_fn_batches!(expr, expected); + assert_fn_batches!(expr); Ok(()) } @@ -331,7 +344,7 @@ async fn test_fn_coalesce() -> Result<()> { "+---------------------------------+", ]; - assert_fn_batches!(expr, expected); + assert_fn_batches!(expr); Ok(()) } @@ -411,7 +424,7 @@ async fn test_fn_character_length() -> Result<()> { "+--------------------------+", ]; - assert_fn_batches!(expr, expected); + assert_fn_batches!(expr); Ok(()) } @@ -428,7 +441,7 @@ async fn test_fn_chr() -> Result<()> { "+--------------------+", ]; - assert_fn_batches!(expr, expected, 1); + assert_fn_batches!(expr, 1); Ok(()) } @@ -448,7 +461,7 @@ async fn test_fn_initcap() -> Result<()> { "+-----------------+", ]; - assert_fn_batches!(expr, expected); + assert_fn_batches!(expr); Ok(()) } @@ -469,7 +482,7 @@ async fn test_fn_left() -> Result<()> { "+-----------------------+", ]; - assert_fn_batches!(expr, expected); + assert_fn_batches!(expr); Ok(()) } @@ -489,7 +502,7 @@ async fn test_fn_lower() -> Result<()> { "+---------------+", ]; - assert_fn_batches!(expr, expected); + assert_fn_batches!(expr); Ok(()) } @@ -510,7 +523,7 @@ async fn test_fn_lpad() -> Result<()> { "+------------------------+", ]; - assert_fn_batches!(expr, expected); + assert_fn_batches!(expr); Ok(()) } @@ -531,7 +544,7 @@ async fn test_fn_lpad_with_string() -> Result<()> { "+----------------------------------+", ]; - assert_fn_batches!(expr, expected); + assert_fn_batches!(expr); Ok(()) } @@ -548,7 +561,7 @@ async fn test_fn_ltrim() -> Result<()> { "+-----------------------------------------+", ]; - assert_fn_batches!(expr, expected, 1); + assert_fn_batches!(expr, 1); Ok(()) } @@ -568,7 +581,7 @@ async fn test_fn_ltrim_with_columns() -> Result<()> { "+---------------+", ]; - assert_fn_batches!(expr, expected); + assert_fn_batches!(expr); Ok(()) } @@ -589,7 +602,7 @@ async fn test_fn_md5() -> Result<()> { "+----------------------------------+", ]; - assert_fn_batches!(expr, expected); + assert_fn_batches!(expr); Ok(()) } @@ -610,7 +623,7 @@ async fn test_fn_regexp_like() -> Result<()> { "+-----------------------------------+", ]; - assert_fn_batches!(expr, expected); + assert_fn_batches!(expr); Ok(()) } @@ -631,7 +644,7 @@ async fn test_fn_regexp_match() -> Result<()> { "+------------------------------------+", ]; - assert_fn_batches!(expr, expected); + assert_fn_batches!(expr); Ok(()) } @@ -652,7 +665,7 @@ async fn test_fn_regexp_replace() -> Result<()> { "+----------------------------------------------------------+", ]; - assert_fn_batches!(expr, expected); + assert_fn_batches!(expr); Ok(()) } @@ -672,7 +685,7 @@ async fn test_fn_replace() -> Result<()> { "+---------------------------------------+", ]; - assert_fn_batches!(expr, expected); + assert_fn_batches!(expr); Ok(()) } @@ -692,7 +705,7 @@ async fn test_fn_repeat() -> Result<()> { "+-------------------------+", ]; - assert_fn_batches!(expr, expected); + assert_fn_batches!(expr); Ok(()) } @@ -713,7 +726,7 @@ async fn test_fn_reverse() -> Result<()> { "+-----------------+", ]; - assert_fn_batches!(expr, expected); + assert_fn_batches!(expr); Ok(()) } @@ -734,7 +747,7 @@ async fn test_fn_right() -> Result<()> { "+------------------------+", ]; - assert_fn_batches!(expr, expected); + assert_fn_batches!(expr); Ok(()) } @@ -755,7 +768,7 @@ async fn test_fn_rpad() -> Result<()> { "+------------------------+", ]; - assert_fn_batches!(expr, expected); + assert_fn_batches!(expr); Ok(()) } @@ -776,7 +789,7 @@ async fn test_fn_rpad_with_characters() -> Result<()> { "+----------------------------------+", ]; - assert_fn_batches!(expr, expected); + assert_fn_batches!(expr); Ok(()) } @@ -797,7 +810,7 @@ async fn test_fn_sha224() -> Result<()> { "+----------------------------------------------------------+", ]; - assert_fn_batches!(expr, expected); + assert_fn_batches!(expr); Ok(()) } @@ -816,7 +829,7 @@ async fn test_fn_split_part() -> Result<()> { "| 123A |", "+---------------------------------------+", ]; - assert_fn_batches!(expr, expected); + assert_fn_batches!(expr); Ok(()) } @@ -836,7 +849,7 @@ async fn test_fn_starts_with() -> Result<()> { "+---------------------------------+", ]; - assert_fn_batches!(expr, expected); + assert_fn_batches!(expr); Ok(()) } @@ -856,7 +869,7 @@ async fn test_fn_ends_with() -> Result<()> { "+-------------------------------+", ]; - assert_fn_batches!(expr, expected); + assert_fn_batches!(expr); Ok(()) } @@ -865,18 +878,7 @@ async fn test_fn_ends_with() -> Result<()> { #[cfg(feature = "unicode_expressions")] async fn test_fn_strpos() -> Result<()> { let expr = strpos(col("a"), lit("f")); - - let expected = [ - "+--------------------------+", - "| strpos(test.a,Utf8(\"f\")) |", - "+--------------------------+", - "| 0 |", - "| 0 |", - "| 6 |", - "| 9 |", - "+--------------------------+", - ]; - assert_fn_batches!(expr, expected); + assert_fn_batches!(expr); Ok(()) } @@ -896,7 +898,7 @@ async fn test_fn_substr() -> Result<()> { "| 23AbcDef |", "+-------------------------+", ]; - assert_fn_batches!(expr, expected); + assert_fn_batches!(expr); Ok(()) } @@ -915,7 +917,7 @@ async fn test_cast() -> Result<()> { "+--------+", ]; - assert_fn_batches!(expr, expected); + assert_fn_batches!(expr); Ok(()) } @@ -934,7 +936,7 @@ async fn test_fn_to_hex() -> Result<()> { "| 64 |", "+----------------+", ]; - assert_fn_batches!(expr, expected); + assert_fn_batches!(expr); Ok(()) } @@ -954,7 +956,7 @@ async fn test_fn_translate() -> Result<()> { "| 123AxxDef |", "+-----------------------------------------+", ]; - assert_fn_batches!(expr, expected); + assert_fn_batches!(expr); Ok(()) } @@ -973,7 +975,7 @@ async fn test_fn_upper() -> Result<()> { "| 123ABCDEF |", "+---------------+", ]; - assert_fn_batches!(expr, expected); + assert_fn_batches!(expr); Ok(()) } @@ -992,7 +994,7 @@ async fn test_fn_encode() -> Result<()> { "| 313233416263446566 |", "+----------------------------+", ]; - assert_fn_batches!(expr, expected); + assert_fn_batches!(expr); Ok(()) } @@ -1018,7 +1020,7 @@ async fn test_fn_decode() -> Result<()> { "| 123AbcDef |", "+------------------------------------------------+", ]; - assert_fn_batches!(expr, expected); + assert_fn_batches!(expr); Ok(()) } @@ -1037,7 +1039,7 @@ async fn test_fn_array_to_string() -> Result<()> { "| 6***7 |", "+-------------------------------------+", ]; - assert_fn_batches!(expr, expected); + assert_fn_batches!(expr); Ok(()) } diff --git a/datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__cast.snap b/datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__cast.snap new file mode 100644 index 000000000000..4e6ebd350eb3 --- /dev/null +++ b/datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__cast.snap @@ -0,0 +1,12 @@ +--- +source: datafusion/core/tests/dataframe/dataframe_functions.rs +expression: actual_lines +--- +- +--------+ +- "| test.b |" +- +--------+ +- "| 1.0 |" +- "| 10.0 |" +- "| 10.0 |" +- "| 100.0 |" +- +--------+ diff --git a/datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__fn_array_to_string.snap b/datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__fn_array_to_string.snap new file mode 100644 index 000000000000..3ae701997b98 --- /dev/null +++ b/datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__fn_array_to_string.snap @@ -0,0 +1,12 @@ +--- +source: datafusion/core/tests/dataframe/dataframe_functions.rs +expression: actual_lines +--- +- +--------------------------------------+ +- "| array_to_string(test.l, Utf8(\"***\")) |" +- +--------------------------------------+ +- "| 0***1***2 |" +- "| |" +- "| 3***5 |" +- "| 6***7 |" +- +--------------------------------------+ diff --git a/datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__fn_arrow_cast.snap b/datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__fn_arrow_cast.snap new file mode 100644 index 000000000000..1c50e8afa489 --- /dev/null +++ b/datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__fn_arrow_cast.snap @@ -0,0 +1,12 @@ +--- +source: datafusion/core/tests/dataframe/dataframe_functions.rs +expression: actual_lines +--- +- +---------------------------------------------------+ +- "| arrow_typeof(arrow_cast(test.b, Utf8(\"Float64\"))) |" +- +---------------------------------------------------+ +- "| Float64 |" +- "| Float64 |" +- "| Float64 |" +- "| Float64 |" +- +---------------------------------------------------+ diff --git a/datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__fn_arrow_typeof.snap b/datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__fn_arrow_typeof.snap new file mode 100644 index 000000000000..e78139320855 --- /dev/null +++ b/datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__fn_arrow_typeof.snap @@ -0,0 +1,12 @@ +--- +source: datafusion/core/tests/dataframe/dataframe_functions.rs +expression: actual_lines +--- +- +------------------------------------------------------------------------------------------------------------------+ +- "| arrow_typeof(test.l) |" +- +------------------------------------------------------------------------------------------------------------------+ +- "| List(Field { name: \"item\", data_type: Int32, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }) |" +- "| List(Field { name: \"item\", data_type: Int32, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }) |" +- "| List(Field { name: \"item\", data_type: Int32, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }) |" +- "| List(Field { name: \"item\", data_type: Int32, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }) |" +- +------------------------------------------------------------------------------------------------------------------+ diff --git a/datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__fn_ascii.snap b/datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__fn_ascii.snap new file mode 100644 index 000000000000..2b5c7bab94c0 --- /dev/null +++ b/datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__fn_ascii.snap @@ -0,0 +1,9 @@ +--- +source: datafusion/core/tests/dataframe/dataframe_functions.rs +expression: actual_lines +--- +- +---------------+ +- "| ascii(test.a) |" +- +---------------+ +- "| 97 |" +- +---------------+ diff --git a/datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__fn_bit_length.snap b/datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__fn_bit_length.snap new file mode 100644 index 000000000000..5ee180b8146d --- /dev/null +++ b/datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__fn_bit_length.snap @@ -0,0 +1,12 @@ +--- +source: datafusion/core/tests/dataframe/dataframe_functions.rs +expression: actual_lines +--- +- +--------------------+ +- "| bit_length(test.a) |" +- +--------------------+ +- "| 48 |" +- "| 48 |" +- "| 48 |" +- "| 72 |" +- +--------------------+ diff --git a/datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__fn_btrim.snap b/datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__fn_btrim.snap new file mode 100644 index 000000000000..73bcc4e6c368 --- /dev/null +++ b/datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__fn_btrim.snap @@ -0,0 +1,9 @@ +--- +source: datafusion/core/tests/dataframe/dataframe_functions.rs +expression: actual_lines +--- +- +-----------------------------------------+ +- "| btrim(Utf8(\" a b c \")) |" +- +-----------------------------------------+ +- "| a b c |" +- +-----------------------------------------+ diff --git a/datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__fn_btrim_with_chars.snap b/datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__fn_btrim_with_chars.snap new file mode 100644 index 000000000000..09d2cfde9ac8 --- /dev/null +++ b/datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__fn_btrim_with_chars.snap @@ -0,0 +1,12 @@ +--- +source: datafusion/core/tests/dataframe/dataframe_functions.rs +expression: actual_lines +--- +- +---------------------------+ +- "| btrim(test.a, Utf8(\"ab\")) |" +- +---------------------------+ +- "| cDEF |" +- "| c123 |" +- "| CBAdef |" +- "| 123AbcDef |" +- +---------------------------+ diff --git a/datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__fn_character_length.snap b/datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__fn_character_length.snap new file mode 100644 index 000000000000..c070cf9cf3b4 --- /dev/null +++ b/datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__fn_character_length.snap @@ -0,0 +1,12 @@ +--- +source: datafusion/core/tests/dataframe/dataframe_functions.rs +expression: actual_lines +--- +- +--------------------------+ +- "| character_length(test.a) |" +- +--------------------------+ +- "| 6 |" +- "| 6 |" +- "| 6 |" +- "| 9 |" +- +--------------------------+ diff --git a/datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__fn_chr.snap b/datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__fn_chr.snap new file mode 100644 index 000000000000..9ca83c83f452 --- /dev/null +++ b/datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__fn_chr.snap @@ -0,0 +1,9 @@ +--- +source: datafusion/core/tests/dataframe/dataframe_functions.rs +expression: actual_lines +--- +- +--------------------+ +- "| chr(Int32(128175)) |" +- +--------------------+ +- "| 💯 |" +- +--------------------+ diff --git a/datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__fn_coalesce.snap b/datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__fn_coalesce.snap new file mode 100644 index 000000000000..48872563da3f --- /dev/null +++ b/datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__fn_coalesce.snap @@ -0,0 +1,12 @@ +--- +source: datafusion/core/tests/dataframe/dataframe_functions.rs +expression: actual_lines +--- +- +----------------------------------+ +- "| coalesce(Utf8(NULL), Utf8(\"ab\")) |" +- +----------------------------------+ +- "| ab |" +- "| ab |" +- "| ab |" +- "| ab |" +- +----------------------------------+ diff --git a/datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__fn_decode.snap b/datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__fn_decode.snap new file mode 100644 index 000000000000..64324e17aece --- /dev/null +++ b/datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__fn_decode.snap @@ -0,0 +1,12 @@ +--- +source: datafusion/core/tests/dataframe/dataframe_functions.rs +expression: actual_lines +--- +- +--------------------------------------------------+ +- "| decode(encode(test.a, Utf8(\"hex\")), Utf8(\"hex\")) |" +- +--------------------------------------------------+ +- "| abcDEF |" +- "| abc123 |" +- "| CBAdef |" +- "| 123AbcDef |" +- +--------------------------------------------------+ diff --git a/datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__fn_encode.snap b/datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__fn_encode.snap new file mode 100644 index 000000000000..1b8c090b4ae0 --- /dev/null +++ b/datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__fn_encode.snap @@ -0,0 +1,12 @@ +--- +source: datafusion/core/tests/dataframe/dataframe_functions.rs +expression: actual_lines +--- +- +-----------------------------+ +- "| encode(test.a, Utf8(\"hex\")) |" +- +-----------------------------+ +- "| 616263444546 |" +- "| 616263313233 |" +- "| 434241646566 |" +- "| 313233416263446566 |" +- +-----------------------------+ diff --git a/datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__fn_ends_with.snap b/datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__fn_ends_with.snap new file mode 100644 index 000000000000..a75978955c81 --- /dev/null +++ b/datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__fn_ends_with.snap @@ -0,0 +1,12 @@ +--- +source: datafusion/core/tests/dataframe/dataframe_functions.rs +expression: actual_lines +--- +- +--------------------------------+ +- "| ends_with(test.a, Utf8(\"DEF\")) |" +- +--------------------------------+ +- "| true |" +- "| false |" +- "| false |" +- "| false |" +- +--------------------------------+ diff --git a/datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__fn_initcap.snap b/datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__fn_initcap.snap new file mode 100644 index 000000000000..329b64e51331 --- /dev/null +++ b/datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__fn_initcap.snap @@ -0,0 +1,12 @@ +--- +source: datafusion/core/tests/dataframe/dataframe_functions.rs +expression: actual_lines +--- +- +-----------------+ +- "| initcap(test.a) |" +- +-----------------+ +- "| Abcdef |" +- "| Abc123 |" +- "| Cbadef |" +- "| 123abcdef |" +- +-----------------+ diff --git a/datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__fn_left.snap b/datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__fn_left.snap new file mode 100644 index 000000000000..27b0ed2ea0c2 --- /dev/null +++ b/datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__fn_left.snap @@ -0,0 +1,12 @@ +--- +source: datafusion/core/tests/dataframe/dataframe_functions.rs +expression: actual_lines +--- +- +------------------------+ +- "| left(test.a, Int32(3)) |" +- +------------------------+ +- "| abc |" +- "| abc |" +- "| CBA |" +- "| 123 |" +- +------------------------+ diff --git a/datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__fn_lower.snap b/datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__fn_lower.snap new file mode 100644 index 000000000000..4716c23b0bfd --- /dev/null +++ b/datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__fn_lower.snap @@ -0,0 +1,12 @@ +--- +source: datafusion/core/tests/dataframe/dataframe_functions.rs +expression: actual_lines +--- +- +---------------+ +- "| lower(test.a) |" +- +---------------+ +- "| abcdef |" +- "| abc123 |" +- "| cbadef |" +- "| 123abcdef |" +- +---------------+ diff --git a/datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__fn_lpad.snap b/datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__fn_lpad.snap new file mode 100644 index 000000000000..dcfc0cd5cde9 --- /dev/null +++ b/datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__fn_lpad.snap @@ -0,0 +1,12 @@ +--- +source: datafusion/core/tests/dataframe/dataframe_functions.rs +expression: actual_lines +--- +- +-------------------------+ +- "| lpad(test.a, Int32(10)) |" +- +-------------------------+ +- "| abcDEF |" +- "| abc123 |" +- "| CBAdef |" +- "| 123AbcDef |" +- +-------------------------+ diff --git a/datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__fn_lpad_with_string.snap b/datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__fn_lpad_with_string.snap new file mode 100644 index 000000000000..e704dce5b47a --- /dev/null +++ b/datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__fn_lpad_with_string.snap @@ -0,0 +1,12 @@ +--- +source: datafusion/core/tests/dataframe/dataframe_functions.rs +expression: actual_lines +--- +- +------------------------------------+ +- "| lpad(test.a, Int32(10), Utf8(\"*\")) |" +- +------------------------------------+ +- "| ****abcDEF |" +- "| ****abc123 |" +- "| ****CBAdef |" +- "| *123AbcDef |" +- +------------------------------------+ diff --git a/datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__fn_ltrim.snap b/datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__fn_ltrim.snap new file mode 100644 index 000000000000..461f269d9842 --- /dev/null +++ b/datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__fn_ltrim.snap @@ -0,0 +1,9 @@ +--- +source: datafusion/core/tests/dataframe/dataframe_functions.rs +expression: actual_lines +--- +- +-----------------------------------------+ +- "| ltrim(Utf8(\" a b c \")) |" +- +-----------------------------------------+ +- "| a b c |" +- +-----------------------------------------+ diff --git a/datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__fn_ltrim_with_columns.snap b/datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__fn_ltrim_with_columns.snap new file mode 100644 index 000000000000..5d5590223078 --- /dev/null +++ b/datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__fn_ltrim_with_columns.snap @@ -0,0 +1,12 @@ +--- +source: datafusion/core/tests/dataframe/dataframe_functions.rs +expression: actual_lines +--- +- +---------------+ +- "| ltrim(test.a) |" +- +---------------+ +- "| abcDEF |" +- "| abc123 |" +- "| CBAdef |" +- "| 123AbcDef |" +- +---------------+ diff --git a/datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__fn_md5.snap b/datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__fn_md5.snap new file mode 100644 index 000000000000..0c4b22661c55 --- /dev/null +++ b/datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__fn_md5.snap @@ -0,0 +1,12 @@ +--- +source: datafusion/core/tests/dataframe/dataframe_functions.rs +expression: actual_lines +--- +- +----------------------------------+ +- "| md5(test.a) |" +- +----------------------------------+ +- "| ea2de8bd80f3a1f52c754214fc9b0ed1 |" +- "| e99a18c428cb38d5f260853678922e03 |" +- "| 11ed4a6e9985df40913eead67f022e27 |" +- "| 8f5e60e523c9253e623ae38bb58c399a |" +- +----------------------------------+ diff --git a/datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__fn_named_struct.snap b/datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__fn_named_struct.snap new file mode 100644 index 000000000000..8b0ff2e91251 --- /dev/null +++ b/datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__fn_named_struct.snap @@ -0,0 +1,12 @@ +--- +source: datafusion/core/tests/dataframe/dataframe_functions.rs +expression: actual_lines +--- +- +------------------------------------------------------------------+ +- "| named_struct(Utf8(\"column_a\"), test.a, Utf8(\"column_b\"), test.b) |" +- +------------------------------------------------------------------+ +- "| {column_a: abcDEF, column_b: 1} |" +- "| {column_a: abc123, column_b: 10} |" +- "| {column_a: CBAdef, column_b: 10} |" +- "| {column_a: 123AbcDef, column_b: 100} |" +- +------------------------------------------------------------------+ diff --git a/datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__fn_nullif.snap b/datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__fn_nullif.snap new file mode 100644 index 000000000000..1208966cac0d --- /dev/null +++ b/datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__fn_nullif.snap @@ -0,0 +1,12 @@ +--- +source: datafusion/core/tests/dataframe/dataframe_functions.rs +expression: actual_lines +--- +- +--------------------------------+ +- "| nullif(test.a, Utf8(\"abcDEF\")) |" +- +--------------------------------+ +- "| |" +- "| abc123 |" +- "| CBAdef |" +- "| 123AbcDef |" +- +--------------------------------+ diff --git a/datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__fn_regexp_like.snap b/datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__fn_regexp_like.snap new file mode 100644 index 000000000000..678ecc5c2aa0 --- /dev/null +++ b/datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__fn_regexp_like.snap @@ -0,0 +1,12 @@ +--- +source: datafusion/core/tests/dataframe/dataframe_functions.rs +expression: actual_lines +--- +- +------------------------------------+ +- "| regexp_like(test.a, Utf8(\"[a-z]\")) |" +- +------------------------------------+ +- "| true |" +- "| true |" +- "| true |" +- "| true |" +- +------------------------------------+ diff --git a/datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__fn_regexp_match.snap b/datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__fn_regexp_match.snap new file mode 100644 index 000000000000..413a57e0fa16 --- /dev/null +++ b/datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__fn_regexp_match.snap @@ -0,0 +1,12 @@ +--- +source: datafusion/core/tests/dataframe/dataframe_functions.rs +expression: actual_lines +--- +- +-------------------------------------+ +- "| regexp_match(test.a, Utf8(\"[a-z]\")) |" +- +-------------------------------------+ +- "| [a] |" +- "| [a] |" +- "| [d] |" +- "| [b] |" +- +-------------------------------------+ diff --git a/datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__fn_regexp_replace.snap b/datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__fn_regexp_replace.snap new file mode 100644 index 000000000000..914fb1d2d5d2 --- /dev/null +++ b/datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__fn_regexp_replace.snap @@ -0,0 +1,12 @@ +--- +source: datafusion/core/tests/dataframe/dataframe_functions.rs +expression: actual_lines +--- +- +-------------------------------------------------------------+ +- "| regexp_replace(test.a, Utf8(\"[a-z]\"), Utf8(\"x\"), Utf8(\"g\")) |" +- +-------------------------------------------------------------+ +- "| xxxDEF |" +- "| xxx123 |" +- "| CBAxxx |" +- "| 123AxxDxx |" +- +-------------------------------------------------------------+ diff --git a/datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__fn_repeat.snap b/datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__fn_repeat.snap new file mode 100644 index 000000000000..aa62ec7263e7 --- /dev/null +++ b/datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__fn_repeat.snap @@ -0,0 +1,12 @@ +--- +source: datafusion/core/tests/dataframe/dataframe_functions.rs +expression: actual_lines +--- +- +--------------------------+ +- "| repeat(test.a, Int32(2)) |" +- +--------------------------+ +- "| abcDEFabcDEF |" +- "| abc123abc123 |" +- "| CBAdefCBAdef |" +- "| 123AbcDef123AbcDef |" +- +--------------------------+ diff --git a/datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__fn_replace.snap b/datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__fn_replace.snap new file mode 100644 index 000000000000..98b45e392f79 --- /dev/null +++ b/datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__fn_replace.snap @@ -0,0 +1,12 @@ +--- +source: datafusion/core/tests/dataframe/dataframe_functions.rs +expression: actual_lines +--- +- +-----------------------------------------+ +- "| replace(test.a, Utf8(\"abc\"), Utf8(\"x\")) |" +- +-----------------------------------------+ +- "| xDEF |" +- "| x123 |" +- "| CBAdef |" +- "| 123AbcDef |" +- +-----------------------------------------+ diff --git a/datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__fn_reverse.snap b/datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__fn_reverse.snap new file mode 100644 index 000000000000..6170f049a405 --- /dev/null +++ b/datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__fn_reverse.snap @@ -0,0 +1,12 @@ +--- +source: datafusion/core/tests/dataframe/dataframe_functions.rs +expression: actual_lines +--- +- +-----------------+ +- "| reverse(test.a) |" +- +-----------------+ +- "| FEDcba |" +- "| 321cba |" +- "| fedABC |" +- "| feDcbA321 |" +- +-----------------+ diff --git a/datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__fn_right.snap b/datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__fn_right.snap new file mode 100644 index 000000000000..a1daccab9ef4 --- /dev/null +++ b/datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__fn_right.snap @@ -0,0 +1,12 @@ +--- +source: datafusion/core/tests/dataframe/dataframe_functions.rs +expression: actual_lines +--- +- +-------------------------+ +- "| right(test.a, Int32(3)) |" +- +-------------------------+ +- "| DEF |" +- "| 123 |" +- "| def |" +- "| Def |" +- +-------------------------+ diff --git a/datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__fn_rpad.snap b/datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__fn_rpad.snap new file mode 100644 index 000000000000..450a445b8e9a --- /dev/null +++ b/datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__fn_rpad.snap @@ -0,0 +1,12 @@ +--- +source: datafusion/core/tests/dataframe/dataframe_functions.rs +expression: actual_lines +--- +- +-------------------------+ +- "| rpad(test.a, Int32(11)) |" +- +-------------------------+ +- "| abcDEF |" +- "| abc123 |" +- "| CBAdef |" +- "| 123AbcDef |" +- +-------------------------+ diff --git a/datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__fn_rpad_with_characters.snap b/datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__fn_rpad_with_characters.snap new file mode 100644 index 000000000000..0c3460780633 --- /dev/null +++ b/datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__fn_rpad_with_characters.snap @@ -0,0 +1,12 @@ +--- +source: datafusion/core/tests/dataframe/dataframe_functions.rs +expression: actual_lines +--- +- +------------------------------------+ +- "| rpad(test.a, Int32(11), Utf8(\"x\")) |" +- +------------------------------------+ +- "| abcDEFxxxxx |" +- "| abc123xxxxx |" +- "| CBAdefxxxxx |" +- "| 123AbcDefxx |" +- +------------------------------------+ diff --git a/datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__fn_sha224.snap b/datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__fn_sha224.snap new file mode 100644 index 000000000000..f58387873854 --- /dev/null +++ b/datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__fn_sha224.snap @@ -0,0 +1,12 @@ +--- +source: datafusion/core/tests/dataframe/dataframe_functions.rs +expression: actual_lines +--- +- +----------------------------------------------------------+ +- "| sha224(test.a) |" +- +----------------------------------------------------------+ +- "| 8b9ef961d2b19cfe7ee2a8452e3adeea98c7b22954b4073976bf80ee |" +- "| 5c69bb695cc29b93d655e1a4bb5656cda624080d686f74477ea09349 |" +- "| b3b3783b7470594e7ddb845eca0aec5270746dd6d0bc309bb948ceab |" +- "| fc8a30d59386d78053328440c6670c3b583404a905cbe9bbd491a517 |" +- +----------------------------------------------------------+ diff --git a/datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__fn_split_part.snap b/datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__fn_split_part.snap new file mode 100644 index 000000000000..9c0916db0595 --- /dev/null +++ b/datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__fn_split_part.snap @@ -0,0 +1,12 @@ +--- +source: datafusion/core/tests/dataframe/dataframe_functions.rs +expression: actual_lines +--- +- +-----------------------------------------+ +- "| split_part(test.a, Utf8(\"b\"), Int32(1)) |" +- +-----------------------------------------+ +- "| a |" +- "| a |" +- "| CBAdef |" +- "| 123A |" +- +-----------------------------------------+ diff --git a/datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__fn_starts_with.snap b/datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__fn_starts_with.snap new file mode 100644 index 000000000000..d49febc02f28 --- /dev/null +++ b/datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__fn_starts_with.snap @@ -0,0 +1,12 @@ +--- +source: datafusion/core/tests/dataframe/dataframe_functions.rs +expression: actual_lines +--- +- +----------------------------------+ +- "| starts_with(test.a, Utf8(\"abc\")) |" +- +----------------------------------+ +- "| true |" +- "| true |" +- "| false |" +- "| false |" +- +----------------------------------+ diff --git a/datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__fn_strpos.snap b/datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__fn_strpos.snap new file mode 100644 index 000000000000..6ad55cdc5ac7 --- /dev/null +++ b/datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__fn_strpos.snap @@ -0,0 +1,12 @@ +--- +source: datafusion/core/tests/dataframe/dataframe_functions.rs +expression: actual_lines +--- +- +---------------------------+ +- "| strpos(test.a, Utf8(\"f\")) |" +- +---------------------------+ +- "| 0 |" +- "| 0 |" +- "| 6 |" +- "| 9 |" +- +---------------------------+ diff --git a/datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__fn_struct.snap b/datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__fn_struct.snap new file mode 100644 index 000000000000..55ade9daea92 --- /dev/null +++ b/datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__fn_struct.snap @@ -0,0 +1,12 @@ +--- +source: datafusion/core/tests/dataframe/dataframe_functions.rs +expression: actual_lines +--- +- +--------------------------+ +- "| struct(test.a, test.b) |" +- +--------------------------+ +- "| {c0: abcDEF, c1: 1} |" +- "| {c0: abc123, c1: 10} |" +- "| {c0: CBAdef, c1: 10} |" +- "| {c0: 123AbcDef, c1: 100} |" +- +--------------------------+ diff --git a/datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__fn_substr.snap b/datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__fn_substr.snap new file mode 100644 index 000000000000..8237e3d8a436 --- /dev/null +++ b/datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__fn_substr.snap @@ -0,0 +1,12 @@ +--- +source: datafusion/core/tests/dataframe/dataframe_functions.rs +expression: actual_lines +--- +- +--------------------------+ +- "| substr(test.a, Int32(2)) |" +- +--------------------------+ +- "| bcDEF |" +- "| bc123 |" +- "| BAdef |" +- "| 23AbcDef |" +- +--------------------------+ diff --git a/datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__fn_to_hex.snap b/datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__fn_to_hex.snap new file mode 100644 index 000000000000..a67f62229c18 --- /dev/null +++ b/datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__fn_to_hex.snap @@ -0,0 +1,12 @@ +--- +source: datafusion/core/tests/dataframe/dataframe_functions.rs +expression: actual_lines +--- +- +----------------+ +- "| to_hex(test.b) |" +- +----------------+ +- "| 1 |" +- "| a |" +- "| a |" +- "| 64 |" +- +----------------+ diff --git a/datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__fn_translate.snap b/datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__fn_translate.snap new file mode 100644 index 000000000000..4a3888e15062 --- /dev/null +++ b/datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__fn_translate.snap @@ -0,0 +1,12 @@ +--- +source: datafusion/core/tests/dataframe/dataframe_functions.rs +expression: actual_lines +--- +- +-------------------------------------------+ +- "| translate(test.a, Utf8(\"bc\"), Utf8(\"xx\")) |" +- +-------------------------------------------+ +- "| axxDEF |" +- "| axx123 |" +- "| CBAdef |" +- "| 123AxxDef |" +- +-------------------------------------------+ diff --git a/datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__fn_upper.snap b/datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__fn_upper.snap new file mode 100644 index 000000000000..9632016dfc14 --- /dev/null +++ b/datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__fn_upper.snap @@ -0,0 +1,12 @@ +--- +source: datafusion/core/tests/dataframe/dataframe_functions.rs +expression: actual_lines +--- +- +---------------+ +- "| upper(test.a) |" +- +---------------+ +- "| ABCDEF |" +- "| ABC123 |" +- "| CBADEF |" +- "| 123ABCDEF |" +- +---------------+ diff --git a/datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__nvl.snap b/datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__nvl.snap new file mode 100644 index 000000000000..e9b8fa1682d2 --- /dev/null +++ b/datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__nvl.snap @@ -0,0 +1,12 @@ +--- +source: datafusion/core/tests/dataframe/dataframe_functions.rs +expression: actual_lines +--- +- +-------------+ +- "| nvl_expr |" +- +-------------+ +- "| TURNED_NULL |" +- "| abc123 |" +- "| CBAdef |" +- "| 123AbcDef |" +- +-------------+ diff --git a/datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__nvl2.snap b/datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__nvl2.snap new file mode 100644 index 000000000000..8ecc87a5cf71 --- /dev/null +++ b/datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__nvl2.snap @@ -0,0 +1,12 @@ +--- +source: datafusion/core/tests/dataframe/dataframe_functions.rs +expression: actual_lines +--- +- +-------------+ +- "| nvl2_expr |" +- +-------------+ +- "| TURNED_NULL |" +- "| NON_NULL |" +- "| NON_NULL |" +- "| NON_NULL |" +- +-------------+ diff --git a/datafusion/expr/src/udf.rs b/datafusion/expr/src/udf.rs index fadea26e7f4e..7ef54e401988 100644 --- a/datafusion/expr/src/udf.rs +++ b/datafusion/expr/src/udf.rs @@ -291,7 +291,7 @@ pub trait ScalarUDFImpl: Debug + Send + Sync { /// fn display_name(&self, args: &[Expr]) -> Result { let names: Vec = args.iter().map(create_name).collect::>()?; - Ok(format!("{}({})", self.name(), names.join(","))) + Ok(format!("{}({})", self.name(), names.join(", "))) } /// Returns the function's [`Signature`] for information about what input From c9844cc948c828fe9b67094632879bc14784d2b8 Mon Sep 17 00:00:00 2001 From: jayzhan211 Date: Sun, 12 May 2024 09:36:43 +0800 Subject: [PATCH 04/11] add more change Signed-off-by: jayzhan211 --- .../tests/dataframe/dataframe_functions.rs | 460 +----------------- ...unctions__fn_approx_percentile_cont-2.snap | 9 + ..._functions__fn_approx_percentile_cont.snap | 9 + 3 files changed, 24 insertions(+), 454 deletions(-) create mode 100644 datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__fn_approx_percentile_cont-2.snap create mode 100644 datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__fn_approx_percentile_cont.snap diff --git a/datafusion/core/tests/dataframe/dataframe_functions.rs b/datafusion/core/tests/dataframe/dataframe_functions.rs index 62d69f617a79..b84c6724ea94 100644 --- a/datafusion/core/tests/dataframe/dataframe_functions.rs +++ b/datafusion/core/tests/dataframe/dataframe_functions.rs @@ -30,7 +30,7 @@ use datafusion::error::Result; use datafusion::prelude::*; use datafusion::assert_batches_eq; -use datafusion_common::{DFSchema, ScalarValue}; +use datafusion_common::{assert_snapshot, DFSchema, ScalarValue}; use datafusion_expr::expr::Alias; use datafusion_expr::ExprSchemable; @@ -88,31 +88,10 @@ macro_rules! assert_fn_batches { }; } -// macro_rules! assert_fn_batches { -// ($EXPR:expr, $EXPECTED: expr) => { -// assert_fn_batches!($EXPR, $EXPECTED, 10) -// }; -// ($EXPR:expr, $LIMIT: expr) => { -// let df = create_test_table().await?; -// let df = df.select(vec![$EXPR])?.limit(0, Some($LIMIT))?; -// let batches = df.collect().await?; - -// assert_batches_eq!($EXPECTED, &batches); -// }; -// } - #[tokio::test] async fn test_fn_ascii() -> Result<()> { let expr = ascii(col("a")); - let expected = [ - "+---------------+", - "| ascii(test.a) |", - "+---------------+", - "| 97 |", - "+---------------+", - ]; - assert_fn_batches!(expr, 1); Ok(()) @@ -122,16 +101,6 @@ async fn test_fn_ascii() -> Result<()> { async fn test_fn_bit_length() -> Result<()> { let expr = bit_length(col("a")); - let expected = [ - "+--------------------+", - "| bit_length(test.a) |", - "+--------------------+", - "| 48 |", - "| 48 |", - "| 48 |", - "| 72 |", - "+--------------------+", - ]; assert_fn_batches!(expr); Ok(()) @@ -141,14 +110,6 @@ async fn test_fn_bit_length() -> Result<()> { async fn test_fn_btrim() -> Result<()> { let expr = btrim(vec![lit(" a b c ")]); - let expected = [ - "+-----------------------------------------+", - "| btrim(Utf8(\" a b c \")) |", - "+-----------------------------------------+", - "| a b c |", - "+-----------------------------------------+", - ]; - assert_fn_batches!(expr, 1); Ok(()) @@ -158,17 +119,6 @@ async fn test_fn_btrim() -> Result<()> { async fn test_fn_btrim_with_chars() -> Result<()> { let expr = btrim(vec![col("a"), lit("ab")]); - let expected = [ - "+--------------------------+", - "| btrim(test.a,Utf8(\"ab\")) |", - "+--------------------------+", - "| cDEF |", - "| c123 |", - "| CBAdef |", - "| 123AbcDef |", - "+--------------------------+", - ]; - assert_fn_batches!(expr); Ok(()) @@ -178,17 +128,6 @@ async fn test_fn_btrim_with_chars() -> Result<()> { async fn test_fn_nullif() -> Result<()> { let expr = nullif(col("a"), lit("abcDEF")); - let expected = [ - "+-------------------------------+", - "| nullif(test.a,Utf8(\"abcDEF\")) |", - "+-------------------------------+", - "| |", - "| abc123 |", - "| CBAdef |", - "| 123AbcDef |", - "+-------------------------------+", - ]; - assert_fn_batches!(expr); Ok(()) @@ -198,17 +137,6 @@ async fn test_fn_nullif() -> Result<()> { async fn test_fn_arrow_cast() -> Result<()> { let expr = arrow_typeof(arrow_cast(col("b"), lit("Float64"))); - let expected = [ - "+--------------------------------------------------+", - "| arrow_typeof(arrow_cast(test.b,Utf8(\"Float64\"))) |", - "+--------------------------------------------------+", - "| Float64 |", - "| Float64 |", - "| Float64 |", - "| Float64 |", - "+--------------------------------------------------+", - ]; - assert_fn_batches!(expr); Ok(()) @@ -226,17 +154,6 @@ async fn test_nvl() -> Result<()> { ) .alias("nvl_expr"); - let expected = [ - "+-------------+", - "| nvl_expr |", - "+-------------+", - "| TURNED_NULL |", - "| abc123 |", - "| CBAdef |", - "| 123AbcDef |", - "+-------------+", - ]; - assert_fn_batches!(expr); Ok(()) @@ -254,17 +171,6 @@ async fn test_nvl2() -> Result<()> { ) .alias("nvl2_expr"); - let expected = [ - "+-------------+", - "| nvl2_expr |", - "+-------------+", - "| TURNED_NULL |", - "| NON_NULL |", - "| NON_NULL |", - "| NON_NULL |", - "+-------------+", - ]; - assert_fn_batches!(expr); Ok(()) @@ -273,17 +179,6 @@ async fn test_nvl2() -> Result<()> { async fn test_fn_arrow_typeof() -> Result<()> { let expr = arrow_typeof(col("l")); - let expected = [ - "+------------------------------------------------------------------------------------------------------------------+", - "| arrow_typeof(test.l) |", - "+------------------------------------------------------------------------------------------------------------------+", - "| List(Field { name: \"item\", data_type: Int32, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }) |", - "| List(Field { name: \"item\", data_type: Int32, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }) |", - "| List(Field { name: \"item\", data_type: Int32, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }) |", - "| List(Field { name: \"item\", data_type: Int32, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }) |", - "+------------------------------------------------------------------------------------------------------------------+", - ]; - assert_fn_batches!(expr); Ok(()) @@ -293,17 +188,6 @@ async fn test_fn_arrow_typeof() -> Result<()> { async fn test_fn_struct() -> Result<()> { let expr = r#struct(vec![col("a"), col("b")]); - let expected = [ - "+--------------------------+", - "| struct(test.a,test.b) |", - "+--------------------------+", - "| {c0: abcDEF, c1: 1} |", - "| {c0: abc123, c1: 10} |", - "| {c0: CBAdef, c1: 10} |", - "| {c0: 123AbcDef, c1: 100} |", - "+--------------------------+", - ]; - assert_fn_batches!(expr); Ok(()) @@ -313,17 +197,6 @@ async fn test_fn_struct() -> Result<()> { async fn test_fn_named_struct() -> Result<()> { let expr = named_struct(vec![lit("column_a"), col("a"), lit("column_b"), col("b")]); - let expected = [ - "+---------------------------------------------------------------+", - "| named_struct(Utf8(\"column_a\"),test.a,Utf8(\"column_b\"),test.b) |", - "+---------------------------------------------------------------+", - "| {column_a: abcDEF, column_b: 1} |", - "| {column_a: abc123, column_b: 10} |", - "| {column_a: CBAdef, column_b: 10} |", - "| {column_a: 123AbcDef, column_b: 100} |", - "+---------------------------------------------------------------+", - ]; - assert_fn_batches!(expr); Ok(()) @@ -333,17 +206,6 @@ async fn test_fn_named_struct() -> Result<()> { async fn test_fn_coalesce() -> Result<()> { let expr = coalesce(vec![lit(ScalarValue::Utf8(None)), lit("ab")]); - let expected = [ - "+---------------------------------+", - "| coalesce(Utf8(NULL),Utf8(\"ab\")) |", - "+---------------------------------+", - "| ab |", - "| ab |", - "| ab |", - "| ab |", - "+---------------------------------+", - ]; - assert_fn_batches!(expr); Ok(()) @@ -373,18 +235,10 @@ async fn test_fn_approx_median() -> Result<()> { async fn test_fn_approx_percentile_cont() -> Result<()> { let expr = approx_percentile_cont(col("b"), lit(0.5)); - let expected = [ - "+---------------------------------------------+", - "| APPROX_PERCENTILE_CONT(test.b,Float64(0.5)) |", - "+---------------------------------------------+", - "| 10 |", - "+---------------------------------------------+", - ]; - let df = create_test_table().await?; let batches = df.aggregate(vec![], vec![expr]).unwrap().collect().await?; - assert_batches_eq!(expected, &batches); + assert_snapshot!(&batches); // the arg2 parameter is a complex expr, but it can be evaluated to the literal value let alias_expr = Expr::Alias(Alias::new( @@ -394,16 +248,9 @@ async fn test_fn_approx_percentile_cont() -> Result<()> { )); let expr = approx_percentile_cont(col("b"), alias_expr); let df = create_test_table().await?; - let expected = [ - "+--------------------------------------+", - "| APPROX_PERCENTILE_CONT(test.b,arg_2) |", - "+--------------------------------------+", - "| 10 |", - "+--------------------------------------+", - ]; let batches = df.aggregate(vec![], vec![expr]).unwrap().collect().await?; - assert_batches_eq!(expected, &batches); + assert_snapshot!(&batches); Ok(()) } @@ -412,20 +259,7 @@ async fn test_fn_approx_percentile_cont() -> Result<()> { #[cfg(feature = "unicode_expressions")] async fn test_fn_character_length() -> Result<()> { let expr = character_length(col("a")); - - let expected = [ - "+--------------------------+", - "| character_length(test.a) |", - "+--------------------------+", - "| 6 |", - "| 6 |", - "| 6 |", - "| 9 |", - "+--------------------------+", - ]; - assert_fn_batches!(expr); - Ok(()) } @@ -433,14 +267,6 @@ async fn test_fn_character_length() -> Result<()> { async fn test_fn_chr() -> Result<()> { let expr = chr(lit(128175)); - let expected = [ - "+--------------------+", - "| chr(Int32(128175)) |", - "+--------------------+", - "| 💯 |", - "+--------------------+", - ]; - assert_fn_batches!(expr, 1); Ok(()) @@ -450,17 +276,6 @@ async fn test_fn_chr() -> Result<()> { async fn test_fn_initcap() -> Result<()> { let expr = initcap(col("a")); - let expected = [ - "+-----------------+", - "| initcap(test.a) |", - "+-----------------+", - "| Abcdef |", - "| Abc123 |", - "| Cbadef |", - "| 123abcdef |", - "+-----------------+", - ]; - assert_fn_batches!(expr); Ok(()) @@ -471,17 +286,6 @@ async fn test_fn_initcap() -> Result<()> { async fn test_fn_left() -> Result<()> { let expr = left(col("a"), lit(3)); - let expected = [ - "+-----------------------+", - "| left(test.a,Int32(3)) |", - "+-----------------------+", - "| abc |", - "| abc |", - "| CBA |", - "| 123 |", - "+-----------------------+", - ]; - assert_fn_batches!(expr); Ok(()) @@ -491,17 +295,6 @@ async fn test_fn_left() -> Result<()> { async fn test_fn_lower() -> Result<()> { let expr = lower(col("a")); - let expected = [ - "+---------------+", - "| lower(test.a) |", - "+---------------+", - "| abcdef |", - "| abc123 |", - "| cbadef |", - "| 123abcdef |", - "+---------------+", - ]; - assert_fn_batches!(expr); Ok(()) @@ -512,17 +305,6 @@ async fn test_fn_lower() -> Result<()> { async fn test_fn_lpad() -> Result<()> { let expr = lpad(vec![col("a"), lit(10)]); - let expected = [ - "+------------------------+", - "| lpad(test.a,Int32(10)) |", - "+------------------------+", - "| abcDEF |", - "| abc123 |", - "| CBAdef |", - "| 123AbcDef |", - "+------------------------+", - ]; - assert_fn_batches!(expr); Ok(()) @@ -533,17 +315,6 @@ async fn test_fn_lpad() -> Result<()> { async fn test_fn_lpad_with_string() -> Result<()> { let expr = lpad(vec![col("a"), lit(10), lit("*")]); - let expected = [ - "+----------------------------------+", - "| lpad(test.a,Int32(10),Utf8(\"*\")) |", - "+----------------------------------+", - "| ****abcDEF |", - "| ****abc123 |", - "| ****CBAdef |", - "| *123AbcDef |", - "+----------------------------------+", - ]; - assert_fn_batches!(expr); Ok(()) @@ -553,14 +324,6 @@ async fn test_fn_lpad_with_string() -> Result<()> { async fn test_fn_ltrim() -> Result<()> { let expr = ltrim(vec![lit(" a b c ")]); - let expected = [ - "+-----------------------------------------+", - "| ltrim(Utf8(\" a b c \")) |", - "+-----------------------------------------+", - "| a b c |", - "+-----------------------------------------+", - ]; - assert_fn_batches!(expr, 1); Ok(()) @@ -570,17 +333,6 @@ async fn test_fn_ltrim() -> Result<()> { async fn test_fn_ltrim_with_columns() -> Result<()> { let expr = ltrim(vec![col("a")]); - let expected = [ - "+---------------+", - "| ltrim(test.a) |", - "+---------------+", - "| abcDEF |", - "| abc123 |", - "| CBAdef |", - "| 123AbcDef |", - "+---------------+", - ]; - assert_fn_batches!(expr); Ok(()) @@ -591,17 +343,6 @@ async fn test_fn_ltrim_with_columns() -> Result<()> { async fn test_fn_md5() -> Result<()> { let expr = md5(col("a")); - let expected = [ - "+----------------------------------+", - "| md5(test.a) |", - "+----------------------------------+", - "| ea2de8bd80f3a1f52c754214fc9b0ed1 |", - "| e99a18c428cb38d5f260853678922e03 |", - "| 11ed4a6e9985df40913eead67f022e27 |", - "| 8f5e60e523c9253e623ae38bb58c399a |", - "+----------------------------------+", - ]; - assert_fn_batches!(expr); Ok(()) @@ -612,7 +353,7 @@ async fn test_fn_md5() -> Result<()> { async fn test_fn_regexp_like() -> Result<()> { let expr = regexp_like(col("a"), lit("[a-z]")); - let expected = [ + let _expected = [ "+-----------------------------------+", "| regexp_like(test.a,Utf8(\"[a-z]\")) |", "+-----------------------------------+", @@ -633,7 +374,7 @@ async fn test_fn_regexp_like() -> Result<()> { async fn test_fn_regexp_match() -> Result<()> { let expr = regexp_match(col("a"), lit("[a-z]")); - let expected = [ + let _expected = [ "+------------------------------------+", "| regexp_match(test.a,Utf8(\"[a-z]\")) |", "+------------------------------------+", @@ -654,7 +395,7 @@ async fn test_fn_regexp_match() -> Result<()> { async fn test_fn_regexp_replace() -> Result<()> { let expr = regexp_replace(col("a"), lit("[a-z]"), lit("x"), lit("g")); - let expected = [ + let _expected = [ "+----------------------------------------------------------+", "| regexp_replace(test.a,Utf8(\"[a-z]\"),Utf8(\"x\"),Utf8(\"g\")) |", "+----------------------------------------------------------+", @@ -674,17 +415,6 @@ async fn test_fn_regexp_replace() -> Result<()> { async fn test_fn_replace() -> Result<()> { let expr = replace(col("a"), lit("abc"), lit("x")); - let expected = [ - "+---------------------------------------+", - "| replace(test.a,Utf8(\"abc\"),Utf8(\"x\")) |", - "+---------------------------------------+", - "| xDEF |", - "| x123 |", - "| CBAdef |", - "| 123AbcDef |", - "+---------------------------------------+", - ]; - assert_fn_batches!(expr); Ok(()) @@ -694,17 +424,6 @@ async fn test_fn_replace() -> Result<()> { async fn test_fn_repeat() -> Result<()> { let expr = repeat(col("a"), lit(2)); - let expected = [ - "+-------------------------+", - "| repeat(test.a,Int32(2)) |", - "+-------------------------+", - "| abcDEFabcDEF |", - "| abc123abc123 |", - "| CBAdefCBAdef |", - "| 123AbcDef123AbcDef |", - "+-------------------------+", - ]; - assert_fn_batches!(expr); Ok(()) @@ -715,17 +434,6 @@ async fn test_fn_repeat() -> Result<()> { async fn test_fn_reverse() -> Result<()> { let expr = reverse(col("a")); - let expected = [ - "+-----------------+", - "| reverse(test.a) |", - "+-----------------+", - "| FEDcba |", - "| 321cba |", - "| fedABC |", - "| feDcbA321 |", - "+-----------------+", - ]; - assert_fn_batches!(expr); Ok(()) @@ -736,17 +444,6 @@ async fn test_fn_reverse() -> Result<()> { async fn test_fn_right() -> Result<()> { let expr = right(col("a"), lit(3)); - let expected = [ - "+------------------------+", - "| right(test.a,Int32(3)) |", - "+------------------------+", - "| DEF |", - "| 123 |", - "| def |", - "| Def |", - "+------------------------+", - ]; - assert_fn_batches!(expr); Ok(()) @@ -757,17 +454,6 @@ async fn test_fn_right() -> Result<()> { async fn test_fn_rpad() -> Result<()> { let expr = rpad(vec![col("a"), lit(11)]); - let expected = [ - "+------------------------+", - "| rpad(test.a,Int32(11)) |", - "+------------------------+", - "| abcDEF |", - "| abc123 |", - "| CBAdef |", - "| 123AbcDef |", - "+------------------------+", - ]; - assert_fn_batches!(expr); Ok(()) @@ -778,17 +464,6 @@ async fn test_fn_rpad() -> Result<()> { async fn test_fn_rpad_with_characters() -> Result<()> { let expr = rpad(vec![col("a"), lit(11), lit("x")]); - let expected = [ - "+----------------------------------+", - "| rpad(test.a,Int32(11),Utf8(\"x\")) |", - "+----------------------------------+", - "| abcDEFxxxxx |", - "| abc123xxxxx |", - "| CBAdefxxxxx |", - "| 123AbcDefxx |", - "+----------------------------------+", - ]; - assert_fn_batches!(expr); Ok(()) @@ -799,17 +474,6 @@ async fn test_fn_rpad_with_characters() -> Result<()> { async fn test_fn_sha224() -> Result<()> { let expr = sha224(col("a")); - let expected = [ - "+----------------------------------------------------------+", - "| sha224(test.a) |", - "+----------------------------------------------------------+", - "| 8b9ef961d2b19cfe7ee2a8452e3adeea98c7b22954b4073976bf80ee |", - "| 5c69bb695cc29b93d655e1a4bb5656cda624080d686f74477ea09349 |", - "| b3b3783b7470594e7ddb845eca0aec5270746dd6d0bc309bb948ceab |", - "| fc8a30d59386d78053328440c6670c3b583404a905cbe9bbd491a517 |", - "+----------------------------------------------------------+", - ]; - assert_fn_batches!(expr); Ok(()) @@ -819,16 +483,6 @@ async fn test_fn_sha224() -> Result<()> { async fn test_fn_split_part() -> Result<()> { let expr = split_part(col("a"), lit("b"), lit(1)); - let expected = [ - "+---------------------------------------+", - "| split_part(test.a,Utf8(\"b\"),Int32(1)) |", - "+---------------------------------------+", - "| a |", - "| a |", - "| CBAdef |", - "| 123A |", - "+---------------------------------------+", - ]; assert_fn_batches!(expr); Ok(()) @@ -838,17 +492,6 @@ async fn test_fn_split_part() -> Result<()> { async fn test_fn_starts_with() -> Result<()> { let expr = starts_with(col("a"), lit("abc")); - let expected = [ - "+---------------------------------+", - "| starts_with(test.a,Utf8(\"abc\")) |", - "+---------------------------------+", - "| true |", - "| true |", - "| false |", - "| false |", - "+---------------------------------+", - ]; - assert_fn_batches!(expr); Ok(()) @@ -858,17 +501,6 @@ async fn test_fn_starts_with() -> Result<()> { async fn test_fn_ends_with() -> Result<()> { let expr = ends_with(col("a"), lit("DEF")); - let expected = [ - "+-------------------------------+", - "| ends_with(test.a,Utf8(\"DEF\")) |", - "+-------------------------------+", - "| true |", - "| false |", - "| false |", - "| false |", - "+-------------------------------+", - ]; - assert_fn_batches!(expr); Ok(()) @@ -888,16 +520,6 @@ async fn test_fn_strpos() -> Result<()> { async fn test_fn_substr() -> Result<()> { let expr = substr(col("a"), lit(2)); - let expected = [ - "+-------------------------+", - "| substr(test.a,Int32(2)) |", - "+-------------------------+", - "| bcDEF |", - "| bc123 |", - "| BAdef |", - "| 23AbcDef |", - "+-------------------------+", - ]; assert_fn_batches!(expr); Ok(()) @@ -906,16 +528,6 @@ async fn test_fn_substr() -> Result<()> { #[tokio::test] async fn test_cast() -> Result<()> { let expr = cast(col("b"), DataType::Float64); - let expected = [ - "+--------+", - "| test.b |", - "+--------+", - "| 1.0 |", - "| 10.0 |", - "| 10.0 |", - "| 100.0 |", - "+--------+", - ]; assert_fn_batches!(expr); @@ -926,16 +538,6 @@ async fn test_cast() -> Result<()> { async fn test_fn_to_hex() -> Result<()> { let expr = to_hex(col("b")); - let expected = [ - "+----------------+", - "| to_hex(test.b) |", - "+----------------+", - "| 1 |", - "| a |", - "| a |", - "| 64 |", - "+----------------+", - ]; assert_fn_batches!(expr); Ok(()) @@ -946,16 +548,6 @@ async fn test_fn_to_hex() -> Result<()> { async fn test_fn_translate() -> Result<()> { let expr = translate(col("a"), lit("bc"), lit("xx")); - let expected = [ - "+-----------------------------------------+", - "| translate(test.a,Utf8(\"bc\"),Utf8(\"xx\")) |", - "+-----------------------------------------+", - "| axxDEF |", - "| axx123 |", - "| CBAdef |", - "| 123AxxDef |", - "+-----------------------------------------+", - ]; assert_fn_batches!(expr); Ok(()) @@ -965,16 +557,6 @@ async fn test_fn_translate() -> Result<()> { async fn test_fn_upper() -> Result<()> { let expr = upper(col("a")); - let expected = [ - "+---------------+", - "| upper(test.a) |", - "+---------------+", - "| ABCDEF |", - "| ABC123 |", - "| CBADEF |", - "| 123ABCDEF |", - "+---------------+", - ]; assert_fn_batches!(expr); Ok(()) @@ -984,16 +566,6 @@ async fn test_fn_upper() -> Result<()> { async fn test_fn_encode() -> Result<()> { let expr = encode(col("a"), lit("hex")); - let expected = [ - "+----------------------------+", - "| encode(test.a,Utf8(\"hex\")) |", - "+----------------------------+", - "| 616263444546 |", - "| 616263313233 |", - "| 434241646566 |", - "| 313233416263446566 |", - "+----------------------------+", - ]; assert_fn_batches!(expr); Ok(()) @@ -1010,16 +582,6 @@ async fn test_fn_decode() -> Result<()> { // so it looks like nothing is done .cast_to(&DataType::Utf8, &df_schema)?; - let expected = [ - "+------------------------------------------------+", - "| decode(encode(test.a,Utf8(\"hex\")),Utf8(\"hex\")) |", - "+------------------------------------------------+", - "| abcDEF |", - "| abc123 |", - "| CBAdef |", - "| 123AbcDef |", - "+------------------------------------------------+", - ]; assert_fn_batches!(expr); Ok(()) @@ -1029,16 +591,6 @@ async fn test_fn_decode() -> Result<()> { async fn test_fn_array_to_string() -> Result<()> { let expr = array_to_string(col("l"), lit("***")); - let expected = [ - "+-------------------------------------+", - "| array_to_string(test.l,Utf8(\"***\")) |", - "+-------------------------------------+", - "| 0***1***2 |", - "| |", - "| 3***5 |", - "| 6***7 |", - "+-------------------------------------+", - ]; assert_fn_batches!(expr); Ok(()) diff --git a/datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__fn_approx_percentile_cont-2.snap b/datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__fn_approx_percentile_cont-2.snap new file mode 100644 index 000000000000..fd3e46979bf0 --- /dev/null +++ b/datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__fn_approx_percentile_cont-2.snap @@ -0,0 +1,9 @@ +--- +source: datafusion/core/tests/dataframe/dataframe_functions.rs +expression: actual_lines +--- +- +---------------------------------------+ +- "| APPROX_PERCENTILE_CONT(test.b, arg_2) |" +- +---------------------------------------+ +- "| 10 |" +- +---------------------------------------+ diff --git a/datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__fn_approx_percentile_cont.snap b/datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__fn_approx_percentile_cont.snap new file mode 100644 index 000000000000..0c5c793ddaa9 --- /dev/null +++ b/datafusion/core/tests/dataframe/snapshots/core_integration__dataframe__dataframe_functions__fn_approx_percentile_cont.snap @@ -0,0 +1,9 @@ +--- +source: datafusion/core/tests/dataframe/dataframe_functions.rs +expression: actual_lines +--- +- +----------------------------------------------+ +- "| APPROX_PERCENTILE_CONT(test.b, Float64(0.5)) |" +- +----------------------------------------------+ +- "| 10 |" +- +----------------------------------------------+ From 0356cf5b10748ef29300d47c9a8e028770ad0798 Mon Sep 17 00:00:00 2001 From: jayzhan211 Date: Sun, 12 May 2024 09:39:12 +0800 Subject: [PATCH 05/11] add comment Signed-off-by: jayzhan211 --- datafusion/core/tests/dataframe/dataframe_functions.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/datafusion/core/tests/dataframe/dataframe_functions.rs b/datafusion/core/tests/dataframe/dataframe_functions.rs index b84c6724ea94..b42605a13ac9 100644 --- a/datafusion/core/tests/dataframe/dataframe_functions.rs +++ b/datafusion/core/tests/dataframe/dataframe_functions.rs @@ -84,6 +84,8 @@ macro_rules! assert_fn_batches { let df = df.select(vec![$EXPR])?.limit(0, Some($LIMIT))?; let batches = df.collect().await?; + // Once result is updated, run command below for snapshot update + // `cargo insta test --accept -p datafusion --test core_integration -- dataframe::dataframe_functions` datafusion_common::assert_snapshot!(&batches); }; } From 660b2c2f375cf6afba63e457043f3eb7145e3e70 Mon Sep 17 00:00:00 2001 From: jayzhan211 Date: Sun, 12 May 2024 12:19:15 +0800 Subject: [PATCH 06/11] fix ci Signed-off-by: jayzhan211 --- datafusion-examples/examples/regexp.rs | 184 +++++++----------- datafusion/core/tests/simplification.rs | 7 +- ...ification__simplify_project_scalar_fn.snap | 5 + ...mplification__simplify_scan_predicate.snap | 5 + 4 files changed, 87 insertions(+), 114 deletions(-) create mode 100644 datafusion/core/tests/snapshots/simplification__simplify_project_scalar_fn.snap create mode 100644 datafusion/core/tests/snapshots/simplification__simplify_scan_predicate.snap diff --git a/datafusion-examples/examples/regexp.rs b/datafusion-examples/examples/regexp.rs index 02e74bae22af..240b908d7da1 100644 --- a/datafusion-examples/examples/regexp.rs +++ b/datafusion-examples/examples/regexp.rs @@ -33,7 +33,7 @@ async fn main() -> Result<()> { let ctx = SessionContext::new(); ctx.register_csv( "examples", - "../../datafusion/physical-expr/tests/data/regex.csv", + "datafusion/physical-expr/tests/data/regex.csv", CsvReadOptions::new(), ) .await?; @@ -55,21 +55,21 @@ async fn main() -> Result<()> { assert_batches_eq!( &[ - "+------------------------------------------------+", - "| regexp_like(examples.values,examples.patterns) |", - "+------------------------------------------------+", - "| true |", - "| true |", - "| false |", - "| false |", - "| false |", - "| false |", - "| true |", - "| true |", - "| true |", - "| true |", - "| true |", - "+------------------------------------------------+", + "+-------------------------------------------------+", + "| regexp_like(examples.values, examples.patterns) |", + "+-------------------------------------------------+", + "| true |", + "| true |", + "| false |", + "| false |", + "| false |", + "| false |", + "| true |", + "| true |", + "| true |", + "| true |", + "| true |", + "+-------------------------------------------------+", ], &result ); @@ -83,21 +83,21 @@ async fn main() -> Result<()> { assert_batches_eq!( &[ - "+---------------------------------------------------------------+", - "| regexp_like(examples.values,examples.patterns,examples.flags) |", - "+---------------------------------------------------------------+", - "| true |", - "| true |", - "| true |", - "| false |", - "| false |", - "| false |", - "| true |", - "| true |", - "| true |", - "| true |", - "| true |", - "+---------------------------------------------------------------+", + "+-----------------------------------------------------------------+", + "| regexp_like(examples.values, examples.patterns, examples.flags) |", + "+-----------------------------------------------------------------+", + "| true |", + "| true |", + "| true |", + "| false |", + "| false |", + "| false |", + "| true |", + "| true |", + "| true |", + "| true |", + "| true |", + "+-----------------------------------------------------------------+" ], &result ); @@ -111,13 +111,7 @@ async fn main() -> Result<()> { .await?; assert_batches_eq!( - &[ - "+---------------------------------------------------+----------------------------------------------------+", - "| regexp_like(Utf8(\"John Smith\"),Utf8(\"^.*Smith$\")) | regexp_like(Utf8(\"Smith Jones\"),Utf8(\"^Smith.*$\")) |", - "+---------------------------------------------------+----------------------------------------------------+", - "| true | true |", - "+---------------------------------------------------+----------------------------------------------------+", - ], + &["+----------------------------------------------------+-----------------------------------------------------+", "| regexp_like(Utf8(\"John Smith\"), Utf8(\"^.*Smith$\")) | regexp_like(Utf8(\"Smith Jones\"), Utf8(\"^Smith.*$\")) |", "+----------------------------------------------------+-----------------------------------------------------+", "| true | true |", "+----------------------------------------------------+-----------------------------------------------------+"], &result ); @@ -185,21 +179,21 @@ async fn main() -> Result<()> { assert_batches_eq!( &[ - "+-------------------------------------------------+", - "| regexp_match(examples.values,examples.patterns) |", - "+-------------------------------------------------+", - "| [a] |", - "| [A] |", - "| |", - "| |", - "| |", - "| |", - "| [010] |", - "| [Düsseldorf] |", - "| [Москва] |", - "| [Köln] |", - "| [اليوم] |", - "+-------------------------------------------------+", + "+--------------------------------------------------+", + "| regexp_match(examples.values, examples.patterns) |", + "+--------------------------------------------------+", + "| [a] |", + "| [A] |", + "| |", + "| |", + "| |", + "| |", + "| [010] |", + "| [Düsseldorf] |", + "| [Москва] |", + "| [Köln] |", + "| [اليوم] |", + "+--------------------------------------------------+" ], &result ); @@ -213,21 +207,21 @@ async fn main() -> Result<()> { assert_batches_eq!( &[ - "+----------------------------------------------------------------+", - "| regexp_match(examples.values,examples.patterns,examples.flags) |", - "+----------------------------------------------------------------+", - "| [a] |", - "| [A] |", - "| [B] |", - "| |", - "| |", - "| |", - "| [010] |", - "| [Düsseldorf] |", - "| [Москва] |", - "| [Köln] |", - "| [اليوم] |", - "+----------------------------------------------------------------+", + "+------------------------------------------------------------------+", + "| regexp_match(examples.values, examples.patterns, examples.flags) |", + "+------------------------------------------------------------------+", + "| [a] |", + "| [A] |", + "| [B] |", + "| |", + "| |", + "| |", + "| [010] |", + "| [Düsseldorf] |", + "| [Москва] |", + "| [Köln] |", + "| [اليوم] |", + "+------------------------------------------------------------------+" ], &result ); @@ -241,13 +235,7 @@ async fn main() -> Result<()> { .await?; assert_batches_eq!( - &[ - "+----------------------------------------------------+-----------------------------------------------------+", - "| regexp_match(Utf8(\"John Smith\"),Utf8(\"^.*Smith$\")) | regexp_match(Utf8(\"Smith Jones\"),Utf8(\"^Smith.*$\")) |", - "+----------------------------------------------------+-----------------------------------------------------+", - "| [John Smith] | [Smith Jones] |", - "+----------------------------------------------------+-----------------------------------------------------+", - ], + &["+-----------------------------------------------------+------------------------------------------------------+", "| regexp_match(Utf8(\"John Smith\"), Utf8(\"^.*Smith$\")) | regexp_match(Utf8(\"Smith Jones\"), Utf8(\"^Smith.*$\")) |", "+-----------------------------------------------------+------------------------------------------------------+", "| [John Smith] | [Smith Jones] |", "+-----------------------------------------------------+------------------------------------------------------+"], &result ); @@ -267,23 +255,7 @@ async fn main() -> Result<()> { .await?; assert_batches_eq!( - &[ - "+---------------------------------------------------------------------------------------------------------+", - "| regexp_replace(examples.values,examples.patterns,examples.replacement,concat(Utf8(\"g\"),examples.flags)) |", - "+---------------------------------------------------------------------------------------------------------+", - "| bbabbbc |", - "| B |", - "| aec |", - "| AbC |", - "| aBC |", - "| 4000 |", - "| xyz |", - "| München |", - "| Moscow |", - "| Koln |", - "| Today |", - "+---------------------------------------------------------------------------------------------------------+", - ], + &["+-------------------------------------------------------------------------------------------------------------+", "| regexp_replace(examples.values, examples.patterns, examples.replacement, concat(Utf8(\"g\"), examples.flags)) |", "+-------------------------------------------------------------------------------------------------------------+", "| bbabbbc |", "| B |", "| aec |", "| AbC |", "| aBC |", "| 4000 |", "| xyz |", "| München |", "| Moscow |", "| Koln |", "| Today |", "+-------------------------------------------------------------------------------------------------------------+"], &result ); @@ -295,13 +267,7 @@ async fn main() -> Result<()> { .await?; assert_batches_eq!( - &[ - "+------------------------------------------------------------------------+", - "| regexp_replace(Utf8(\"foobarbaz\"),Utf8(\"b(..)\"),Utf8(\"X\\1Y\"),Utf8(\"g\")) |", - "+------------------------------------------------------------------------+", - "| fooXarYXazY |", - "+------------------------------------------------------------------------+", - ], + &["+---------------------------------------------------------------------------+", "| regexp_replace(Utf8(\"foobarbaz\"), Utf8(\"b(..)\"), Utf8(\"X\\1Y\"), Utf8(\"g\")) |", "+---------------------------------------------------------------------------+", "| fooXarYXazY |", "+---------------------------------------------------------------------------+"], &result ); @@ -314,11 +280,11 @@ async fn main() -> Result<()> { assert_batches_eq!( &[ - "+--------------------------------------------------------------+", - "| regexp_replace(Utf8(\"foobarbaz\"),Utf8(\"b(..)\"),Utf8(\"X\\1Y\")) |", - "+--------------------------------------------------------------+", - "| fooXarYbaz |", - "+--------------------------------------------------------------+", + "+----------------------------------------------------------------+", + "| regexp_replace(Utf8(\"foobarbaz\"), Utf8(\"b(..)\"), Utf8(\"X\\1Y\")) |", + "+----------------------------------------------------------------+", + "| fooXarYbaz |", + "+----------------------------------------------------------------+" ], &result ); @@ -332,11 +298,11 @@ async fn main() -> Result<()> { assert_batches_eq!( &[ - "+---------------------------------------------------------------+", - "| regexp_replace(Utf8(\"foobarbaz\"),NULL,Utf8(\"X\\1Y\"),Utf8(\"g\")) |", - "+---------------------------------------------------------------+", - "| |", - "+---------------------------------------------------------------+", + "+------------------------------------------------------------------+", + "| regexp_replace(Utf8(\"foobarbaz\"), NULL, Utf8(\"X\\1Y\"), Utf8(\"g\")) |", + "+------------------------------------------------------------------+", + "| |", + "+------------------------------------------------------------------+" ], &result ); diff --git a/datafusion/core/tests/simplification.rs b/datafusion/core/tests/simplification.rs index bb4192983426..801af6f54414 100644 --- a/datafusion/core/tests/simplification.rs +++ b/datafusion/core/tests/simplification.rs @@ -307,10 +307,8 @@ fn simplify_project_scalar_fn() -> Result<()> { // before simplify: power(t.f, 1.0) // after simplify: t.f as "power(t.f, 1.0)" - let expected = "Projection: test.f AS power(test.f,Float64(1))\ - \n TableScan: test"; let actual = get_optimized_plan_formatted(plan, &Utc::now()); - assert_eq!(expected, actual); + insta::assert_yaml_snapshot!(actual); Ok(()) } @@ -330,9 +328,8 @@ fn simplify_scan_predicate() -> Result<()> { // before simplify: t.g = power(t.f, 1.0) // after simplify: (t.g = t.f) as "t.g = power(t.f, 1.0)" - let expected = "TableScan: test, full_filters=[g = f AS g = power(f,Float64(1))]"; let actual = get_optimized_plan_formatted(plan, &Utc::now()); - assert_eq!(expected, actual); + insta::assert_yaml_snapshot!(actual); Ok(()) } diff --git a/datafusion/core/tests/snapshots/simplification__simplify_project_scalar_fn.snap b/datafusion/core/tests/snapshots/simplification__simplify_project_scalar_fn.snap new file mode 100644 index 000000000000..68d7d4e09511 --- /dev/null +++ b/datafusion/core/tests/snapshots/simplification__simplify_project_scalar_fn.snap @@ -0,0 +1,5 @@ +--- +source: datafusion/core/tests/simplification.rs +expression: actual +--- +"Projection: test.f AS power(test.f, Float64(1))\n TableScan: test" diff --git a/datafusion/core/tests/snapshots/simplification__simplify_scan_predicate.snap b/datafusion/core/tests/snapshots/simplification__simplify_scan_predicate.snap new file mode 100644 index 000000000000..ee3fad96f7f8 --- /dev/null +++ b/datafusion/core/tests/snapshots/simplification__simplify_scan_predicate.snap @@ -0,0 +1,5 @@ +--- +source: datafusion/core/tests/simplification.rs +expression: actual +--- +"TableScan: test, full_filters=[g = f AS g = power(f, Float64(1))]" From c84f54e23dbf2723326b881642f29dc66739113d Mon Sep 17 00:00:00 2001 From: jayzhan211 Date: Sun, 12 May 2024 13:28:50 +0800 Subject: [PATCH 07/11] fix ci Signed-off-by: jayzhan211 --- ...te_scalar_function_from_sql_statement.snap | 9 +++++ ..._defined_scalar_functions__scalar_udf.snap | 12 ++++++ .../user_defined/user_defined_aggregates.rs | 38 +++---------------- .../user_defined_scalar_functions.rs | 25 ++---------- 4 files changed, 29 insertions(+), 55 deletions(-) create mode 100644 datafusion/core/tests/user_defined/snapshots/user_defined_integration__user_defined__user_defined_scalar_functions__create_scalar_function_from_sql_statement.snap create mode 100644 datafusion/core/tests/user_defined/snapshots/user_defined_integration__user_defined__user_defined_scalar_functions__scalar_udf.snap diff --git a/datafusion/core/tests/user_defined/snapshots/user_defined_integration__user_defined__user_defined_scalar_functions__create_scalar_function_from_sql_statement.snap b/datafusion/core/tests/user_defined/snapshots/user_defined_integration__user_defined__user_defined_scalar_functions__create_scalar_function_from_sql_statement.snap new file mode 100644 index 000000000000..92f327a74df9 --- /dev/null +++ b/datafusion/core/tests/user_defined/snapshots/user_defined_integration__user_defined__user_defined_scalar_functions__create_scalar_function_from_sql_statement.snap @@ -0,0 +1,9 @@ +--- +source: datafusion/core/tests/user_defined/user_defined_scalar_functions.rs +expression: actual_lines +--- +- +------------------------------------+ +- "| better_add(Float64(2), Float64(2)) |" +- +------------------------------------+ +- "| 4.0 |" +- +------------------------------------+ diff --git a/datafusion/core/tests/user_defined/snapshots/user_defined_integration__user_defined__user_defined_scalar_functions__scalar_udf.snap b/datafusion/core/tests/user_defined/snapshots/user_defined_integration__user_defined__user_defined_scalar_functions__scalar_udf.snap new file mode 100644 index 000000000000..568d06fb621c --- /dev/null +++ b/datafusion/core/tests/user_defined/snapshots/user_defined_integration__user_defined__user_defined_scalar_functions__scalar_udf.snap @@ -0,0 +1,12 @@ +--- +source: datafusion/core/tests/user_defined/user_defined_scalar_functions.rs +expression: actual_lines +--- +- +-----+-----+------------------+ +- "| a | b | my_add(t.a, t.b) |" +- +-----+-----+------------------+ +- "| 1 | 2 | 3 |" +- "| 10 | 12 | 22 |" +- "| 10 | 12 | 22 |" +- "| 100 | 120 | 220 |" +- +-----+-----+------------------+ diff --git a/datafusion/core/tests/user_defined/user_defined_aggregates.rs b/datafusion/core/tests/user_defined/user_defined_aggregates.rs index 8f02fb30b013..49e77607e188 100644 --- a/datafusion/core/tests/user_defined/user_defined_aggregates.rs +++ b/datafusion/core/tests/user_defined/user_defined_aggregates.rs @@ -43,7 +43,7 @@ use datafusion::{ prelude::SessionContext, scalar::ScalarValue, }; -use datafusion_common::{assert_contains, cast::as_primitive_array, exec_err}; +use datafusion_common::{assert_contains, assert_snapshot, cast::as_primitive_array, exec_err}; use datafusion_expr::{ create_udaf, function::AccumulatorArgs, AggregateUDFImpl, GroupsAccumulator, SimpleAggregateUDF, @@ -150,14 +150,7 @@ async fn test_udaf_as_window_with_frame_without_retract_batch() { async fn test_udaf_returning_struct() { let TestContext { ctx, test_state: _ } = TestContext::new(); let sql = "SELECT first(value, time) from t"; - let expected = [ - "+------------------------------------------------+", - "| first(t.value,t.time) |", - "+------------------------------------------------+", - "| {value: 2.0, time: 1970-01-01T00:00:00.000002} |", - "+------------------------------------------------+", - ]; - assert_batches_eq!(expected, &execute(&ctx, sql).await.unwrap()); + assert_snapshot!(&execute(&ctx, sql).await.unwrap()); } /// Demonstrate extracting the fields from a structure using a subquery @@ -165,14 +158,7 @@ async fn test_udaf_returning_struct() { async fn test_udaf_returning_struct_subquery() { let TestContext { ctx, test_state: _ } = TestContext::new(); let sql = "select sq.first['value'], sq.first['time'] from (SELECT first(value, time) as first from t) as sq"; - let expected = [ - "+-----------------+----------------------------+", - "| sq.first[value] | sq.first[time] |", - "+-----------------+----------------------------+", - "| 2.0 | 1970-01-01T00:00:00.000002 |", - "+-----------------+----------------------------+", - ]; - assert_batches_eq!(expected, &execute(&ctx, sql).await.unwrap()); + assert_snapshot!(&execute(&ctx, sql).await.unwrap()); } #[tokio::test] @@ -184,26 +170,12 @@ async fn test_udaf_shadows_builtin_fn() { let sql = "SELECT sum(arrow_cast(time, 'Int64')) from t"; // compute with builtin `sum` aggregator - let expected = [ - "+---------------------------------------+", - "| SUM(arrow_cast(t.time,Utf8(\"Int64\"))) |", - "+---------------------------------------+", - "| 19000 |", - "+---------------------------------------+", - ]; - assert_batches_eq!(expected, &execute(&ctx, sql).await.unwrap()); + assert_snapshot!(&execute(&ctx, sql).await.unwrap()); // Register `TimeSum` with name `sum`. This will shadow the builtin one let sql = "SELECT sum(time) from t"; TimeSum::register(&mut ctx, test_state.clone(), "sum"); - let expected = [ - "+----------------------------+", - "| sum(t.time) |", - "+----------------------------+", - "| 1970-01-01T00:00:00.000019 |", - "+----------------------------+", - ]; - assert_batches_eq!(expected, &execute(&ctx, sql).await.unwrap()); + assert_snapshot!(&execute(&ctx, sql).await.unwrap()); } async fn execute(ctx: &SessionContext, sql: &str) -> Result> { diff --git a/datafusion/core/tests/user_defined/user_defined_scalar_functions.rs b/datafusion/core/tests/user_defined/user_defined_scalar_functions.rs index def9fcb4c61b..0c4995e6930f 100644 --- a/datafusion/core/tests/user_defined/user_defined_scalar_functions.rs +++ b/datafusion/core/tests/user_defined/user_defined_scalar_functions.rs @@ -26,7 +26,7 @@ use datafusion_common::{ assert_batches_eq, assert_batches_sorted_eq, cast::as_float64_array, cast::as_int32_array, not_impl_err, plan_err, ExprSchema, Result, ScalarValue, }; -use datafusion_common::{assert_contains, exec_err, internal_err, DataFusionError}; +use datafusion_common::{assert_contains, assert_snapshot, exec_err, internal_err, DataFusionError}; use datafusion_execution::runtime_env::{RuntimeConfig, RuntimeEnv}; use datafusion_expr::simplify::{ExprSimplifyResult, SimplifyInfo}; use datafusion_expr::{ @@ -134,17 +134,7 @@ async fn scalar_udf() -> Result<()> { let result = DataFrame::new(ctx.state(), plan).collect().await?; - let expected = [ - "+-----+-----+-----------------+", - "| a | b | my_add(t.a,t.b) |", - "+-----+-----+-----------------+", - "| 1 | 2 | 3 |", - "| 10 | 12 | 22 |", - "| 10 | 12 | 22 |", - "| 100 | 120 | 220 |", - "+-----+-----+-----------------+", - ]; - assert_batches_eq!(expected, &result); + assert_snapshot!(&result); let batch = &result[0]; let a = as_int32_array(batch.column(0))?; @@ -889,16 +879,7 @@ async fn create_scalar_function_from_sql_statement() -> Result<()> { .collect() .await?; - assert_batches_eq!( - &[ - "+-----------------------------------+", - "| better_add(Float64(2),Float64(2)) |", - "+-----------------------------------+", - "| 4.0 |", - "+-----------------------------------+", - ], - &result - ); + assert_snapshot!(&result); // statement drops function assert!(ctx.sql("drop function better_add").await.is_ok()); From f566b0b4de27881a342e7d7bf9e2ffe2bb1abe3c Mon Sep 17 00:00:00 2001 From: jayzhan211 Date: Sun, 12 May 2024 13:43:08 +0800 Subject: [PATCH 08/11] upd more Signed-off-by: jayzhan211 --- ...__user_defined_aggregates__udaf_returning_struct.snap | 9 +++++++++ ...fined_aggregates__udaf_returning_struct_subquery.snap | 9 +++++++++ ...er_defined_aggregates__udaf_shadows_builtin_fn-2.snap | 9 +++++++++ ...user_defined_aggregates__udaf_shadows_builtin_fn.snap | 9 +++++++++ 4 files changed, 36 insertions(+) create mode 100644 datafusion/core/tests/user_defined/snapshots/user_defined_integration__user_defined__user_defined_aggregates__udaf_returning_struct.snap create mode 100644 datafusion/core/tests/user_defined/snapshots/user_defined_integration__user_defined__user_defined_aggregates__udaf_returning_struct_subquery.snap create mode 100644 datafusion/core/tests/user_defined/snapshots/user_defined_integration__user_defined__user_defined_aggregates__udaf_shadows_builtin_fn-2.snap create mode 100644 datafusion/core/tests/user_defined/snapshots/user_defined_integration__user_defined__user_defined_aggregates__udaf_shadows_builtin_fn.snap diff --git a/datafusion/core/tests/user_defined/snapshots/user_defined_integration__user_defined__user_defined_aggregates__udaf_returning_struct.snap b/datafusion/core/tests/user_defined/snapshots/user_defined_integration__user_defined__user_defined_aggregates__udaf_returning_struct.snap new file mode 100644 index 000000000000..685d9c19a577 --- /dev/null +++ b/datafusion/core/tests/user_defined/snapshots/user_defined_integration__user_defined__user_defined_aggregates__udaf_returning_struct.snap @@ -0,0 +1,9 @@ +--- +source: datafusion/core/tests/user_defined/user_defined_aggregates.rs +expression: actual_lines +--- +- +------------------------------------------------+ +- "| first(t.value, t.time) |" +- +------------------------------------------------+ +- "| {value: 2.0, time: 1970-01-01T00:00:00.000002} |" +- +------------------------------------------------+ diff --git a/datafusion/core/tests/user_defined/snapshots/user_defined_integration__user_defined__user_defined_aggregates__udaf_returning_struct_subquery.snap b/datafusion/core/tests/user_defined/snapshots/user_defined_integration__user_defined__user_defined_aggregates__udaf_returning_struct_subquery.snap new file mode 100644 index 000000000000..7d53beb75004 --- /dev/null +++ b/datafusion/core/tests/user_defined/snapshots/user_defined_integration__user_defined__user_defined_aggregates__udaf_returning_struct_subquery.snap @@ -0,0 +1,9 @@ +--- +source: datafusion/core/tests/user_defined/user_defined_aggregates.rs +expression: actual_lines +--- +- +-----------------+----------------------------+ +- "| sq.first[value] | sq.first[time] |" +- +-----------------+----------------------------+ +- "| 2.0 | 1970-01-01T00:00:00.000002 |" +- +-----------------+----------------------------+ diff --git a/datafusion/core/tests/user_defined/snapshots/user_defined_integration__user_defined__user_defined_aggregates__udaf_shadows_builtin_fn-2.snap b/datafusion/core/tests/user_defined/snapshots/user_defined_integration__user_defined__user_defined_aggregates__udaf_shadows_builtin_fn-2.snap new file mode 100644 index 000000000000..91052b5c9a6e --- /dev/null +++ b/datafusion/core/tests/user_defined/snapshots/user_defined_integration__user_defined__user_defined_aggregates__udaf_shadows_builtin_fn-2.snap @@ -0,0 +1,9 @@ +--- +source: datafusion/core/tests/user_defined/user_defined_aggregates.rs +expression: actual_lines +--- +- +----------------------------+ +- "| sum(t.time) |" +- +----------------------------+ +- "| 1970-01-01T00:00:00.000019 |" +- +----------------------------+ diff --git a/datafusion/core/tests/user_defined/snapshots/user_defined_integration__user_defined__user_defined_aggregates__udaf_shadows_builtin_fn.snap b/datafusion/core/tests/user_defined/snapshots/user_defined_integration__user_defined__user_defined_aggregates__udaf_shadows_builtin_fn.snap new file mode 100644 index 000000000000..2b9f3fc542a9 --- /dev/null +++ b/datafusion/core/tests/user_defined/snapshots/user_defined_integration__user_defined__user_defined_aggregates__udaf_shadows_builtin_fn.snap @@ -0,0 +1,9 @@ +--- +source: datafusion/core/tests/user_defined/user_defined_aggregates.rs +expression: actual_lines +--- +- +----------------------------------------+ +- "| SUM(arrow_cast(t.time, Utf8(\"Int64\"))) |" +- +----------------------------------------+ +- "| 19000 |" +- +----------------------------------------+ From 26d2ee38b439838dfd9866dc7b09190773809621 Mon Sep 17 00:00:00 2001 From: jayzhan211 Date: Sun, 12 May 2024 13:43:47 +0800 Subject: [PATCH 09/11] fmt Signed-off-by: jayzhan211 --- datafusion/core/tests/user_defined/user_defined_aggregates.rs | 4 +++- .../core/tests/user_defined/user_defined_scalar_functions.rs | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/datafusion/core/tests/user_defined/user_defined_aggregates.rs b/datafusion/core/tests/user_defined/user_defined_aggregates.rs index 49e77607e188..6b0a36dc97a1 100644 --- a/datafusion/core/tests/user_defined/user_defined_aggregates.rs +++ b/datafusion/core/tests/user_defined/user_defined_aggregates.rs @@ -43,7 +43,9 @@ use datafusion::{ prelude::SessionContext, scalar::ScalarValue, }; -use datafusion_common::{assert_contains, assert_snapshot, cast::as_primitive_array, exec_err}; +use datafusion_common::{ + assert_contains, assert_snapshot, cast::as_primitive_array, exec_err, +}; use datafusion_expr::{ create_udaf, function::AccumulatorArgs, AggregateUDFImpl, GroupsAccumulator, SimpleAggregateUDF, diff --git a/datafusion/core/tests/user_defined/user_defined_scalar_functions.rs b/datafusion/core/tests/user_defined/user_defined_scalar_functions.rs index 0c4995e6930f..4b809d6f7c5b 100644 --- a/datafusion/core/tests/user_defined/user_defined_scalar_functions.rs +++ b/datafusion/core/tests/user_defined/user_defined_scalar_functions.rs @@ -26,7 +26,9 @@ use datafusion_common::{ assert_batches_eq, assert_batches_sorted_eq, cast::as_float64_array, cast::as_int32_array, not_impl_err, plan_err, ExprSchema, Result, ScalarValue, }; -use datafusion_common::{assert_contains, assert_snapshot, exec_err, internal_err, DataFusionError}; +use datafusion_common::{ + assert_contains, assert_snapshot, exec_err, internal_err, DataFusionError, +}; use datafusion_execution::runtime_env::{RuntimeConfig, RuntimeEnv}; use datafusion_expr::simplify::{ExprSimplifyResult, SimplifyInfo}; use datafusion_expr::{ From 3d0ca6fed4ec6c5a837f09309b9171e6686e3431 Mon Sep 17 00:00:00 2001 From: jayzhan211 Date: Sun, 12 May 2024 14:01:10 +0800 Subject: [PATCH 10/11] file Signed-off-by: jayzhan211 --- datafusion-examples/examples/regexp.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/datafusion-examples/examples/regexp.rs b/datafusion-examples/examples/regexp.rs index 240b908d7da1..0ec6d06a4e01 100644 --- a/datafusion-examples/examples/regexp.rs +++ b/datafusion-examples/examples/regexp.rs @@ -33,7 +33,7 @@ async fn main() -> Result<()> { let ctx = SessionContext::new(); ctx.register_csv( "examples", - "datafusion/physical-expr/tests/data/regex.csv", + "../../datafusion/physical-expr/tests/data/regex.csv", CsvReadOptions::new(), ) .await?; From 7e42d8c74dc116f3c16b5029df4982e125d27f37 Mon Sep 17 00:00:00 2001 From: jayzhan211 Date: Sun, 12 May 2024 15:47:07 +0800 Subject: [PATCH 11/11] fix tochar Signed-off-by: jayzhan211 --- datafusion-examples/examples/to_char.rs | 94 ++++++++++++------------- 1 file changed, 47 insertions(+), 47 deletions(-) diff --git a/datafusion-examples/examples/to_char.rs b/datafusion-examples/examples/to_char.rs index f8ed68b46f19..fa3b73b9889e 100644 --- a/datafusion-examples/examples/to_char.rs +++ b/datafusion-examples/examples/to_char.rs @@ -62,14 +62,14 @@ async fn main() -> Result<()> { assert_batches_eq!( &[ - "+------------------------------+", - "| to_char(t.values,t.patterns) |", - "+------------------------------+", - "| 2020-09-01 |", - "| 2020:09:02 |", - "| 20200903 |", - "| 04-09-2020 |", - "+------------------------------+", + "+-------------------------------+", + "| to_char(t.values, t.patterns) |", + "+-------------------------------+", + "| 2020-09-01 |", + "| 2020:09:02 |", + "| 20200903 |", + "| 04-09-2020 |", + "+-------------------------------+" ], &result ); @@ -83,14 +83,14 @@ async fn main() -> Result<()> { assert_batches_eq!( &[ - "+------------------------------+", - "| to_char(t.values,t.patterns) |", - "+------------------------------+", - "| 2020-09-01 |", - "| 2020:09:02 |", - "| 20200903 |", - "| 04-09-2020 |", - "+------------------------------+", + "+-------------------------------+", + "| to_char(t.values, t.patterns) |", + "+-------------------------------+", + "| 2020-09-01 |", + "| 2020:09:02 |", + "| 20200903 |", + "| 04-09-2020 |", + "+-------------------------------+" ], &result ); @@ -104,14 +104,14 @@ async fn main() -> Result<()> { assert_batches_eq!( &[ - "+------------------------------------+", - "| to_char(t.values,Utf8(\"%m-%d-%Y\")) |", - "+------------------------------------+", - "| 09-01-2020 |", - "| 09-02-2020 |", - "| 09-03-2020 |", - "| 09-04-2020 |", - "+------------------------------------+", + "+-------------------------------------+", + "| to_char(t.values, Utf8(\"%m-%d-%Y\")) |", + "+-------------------------------------+", + "| 09-01-2020 |", + "| 09-02-2020 |", + "| 09-03-2020 |", + "| 09-04-2020 |", + "+-------------------------------------+" ], &result ); @@ -125,14 +125,14 @@ async fn main() -> Result<()> { assert_batches_eq!( &[ - "+-----------------------------------+", - "| arrow_cast(t.values,Utf8(\"Utf8\")) |", - "+-----------------------------------+", - "| 2020-09-01 |", - "| 2020-09-02 |", - "| 2020-09-03 |", - "| 2020-09-04 |", - "+-----------------------------------+", + "+------------------------------------+", + "| arrow_cast(t.values, Utf8(\"Utf8\")) |", + "+------------------------------------+", + "| 2020-09-01 |", + "| 2020-09-02 |", + "| 2020-09-03 |", + "| 2020-09-04 |", + "+------------------------------------+" ], &result ); @@ -146,11 +146,11 @@ async fn main() -> Result<()> { assert_batches_eq!( &[ - "+-------------------------------------------------------------------------------------------------------------+", - "| to_char(arrow_cast(Utf8(\"2023-08-03 14:38:50Z\"),Utf8(\"Timestamp(Second, None)\")),Utf8(\"%d-%m-%Y %H:%M:%S\")) |", - "+-------------------------------------------------------------------------------------------------------------+", - "| 03-08-2023 14:38:50 |", - "+-------------------------------------------------------------------------------------------------------------+", + "+---------------------------------------------------------------------------------------------------------------+", + "| to_char(arrow_cast(Utf8(\"2023-08-03 14:38:50Z\"), Utf8(\"Timestamp(Second, None)\")), Utf8(\"%d-%m-%Y %H:%M:%S\")) |", + "+---------------------------------------------------------------------------------------------------------------+", + "| 03-08-2023 14:38:50 |", + "+---------------------------------------------------------------------------------------------------------------+" ], &result ); @@ -165,11 +165,11 @@ async fn main() -> Result<()> { assert_batches_eq!( &[ - "+----------------------------------------------------------------------------+", - "| to_char(arrow_cast(Int64(123456),Utf8(\"Duration(Second)\")),Utf8(\"pretty\")) |", - "+----------------------------------------------------------------------------+", - "| 1 days 10 hours 17 mins 36 secs |", - "+----------------------------------------------------------------------------+", + "+------------------------------------------------------------------------------+", + "| to_char(arrow_cast(Int64(123456), Utf8(\"Duration(Second)\")), Utf8(\"pretty\")) |", + "+------------------------------------------------------------------------------+", + "| 1 days 10 hours 17 mins 36 secs |", + "+------------------------------------------------------------------------------+" ], &result ); @@ -184,11 +184,11 @@ async fn main() -> Result<()> { assert_batches_eq!( &[ - "+-----------------------------------------------------------------------------+", - "| to_char(arrow_cast(Int64(123456),Utf8(\"Duration(Second)\")),Utf8(\"iso8601\")) |", - "+-----------------------------------------------------------------------------+", - "| PT123456S |", - "+-----------------------------------------------------------------------------+", + "+-------------------------------------------------------------------------------+", + "| to_char(arrow_cast(Int64(123456), Utf8(\"Duration(Second)\")), Utf8(\"iso8601\")) |", + "+-------------------------------------------------------------------------------+", + "| PT123456S |", + "+-------------------------------------------------------------------------------+" ], &result );