Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion datafusion/physical-plan/src/values.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ use arrow::record_batch::{RecordBatch, RecordBatchOptions};
use datafusion_common::{internal_err, plan_err, Result, ScalarValue};
use datafusion_execution::TaskContext;
use datafusion_physical_expr::EquivalenceProperties;
use itertools::Itertools;

/// Execution plan for values list based relation (produces constant rows)
#[derive(Debug)]
Expand Down Expand Up @@ -151,7 +152,13 @@ impl DisplayAs for ValuesExec {
) -> std::fmt::Result {
match t {
DisplayFormatType::Default | DisplayFormatType::Verbose => {
write!(f, "ValuesExec")
let schema = self
.schema
.fields()
.iter()
.map(|f| format!("{}:{}", f.name(), f.data_type()))
.join(", ");
write!(f, "ValuesExec [{}]", schema)
}
}
}
Expand Down
6 changes: 6 additions & 0 deletions datafusion/sqllogictest/test_files/explain.slt
Original file line number Diff line number Diff line change
Expand Up @@ -415,3 +415,9 @@ logical_plan
physical_plan
01)ProjectionExec: expr=[{c0:1,c1:2.3,c2:abc} as struct(Int64(1),Float64(2.3),Utf8("abc"))]
02)--PlaceholderRowExec

query TT
EXPLAIN VALUES (NULL), (NULL)
----
logical_plan Values: (NULL), (NULL)
physical_plan ValuesExec [column1:Null]
2 changes: 1 addition & 1 deletion datafusion/sqllogictest/test_files/insert_to_external.slt
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ physical_plan
01)DataSinkExec: sink=CsvSink(file_groups=[])
02)--SortExec: expr=[a@0 ASC NULLS LAST,b@1 DESC], preserve_partitioning=[false]
03)----ProjectionExec: expr=[column1@0 as a, column2@1 as b]
04)------ValuesExec
04)------ValuesExec [column1:Int64, column2:Int64]

query I
INSERT INTO ordered_insert_test values (5, 1), (4, 2), (7,7), (7,8), (7,9), (7,10), (3, 3), (2, 4), (1, 5);
Expand Down
4 changes: 2 additions & 2 deletions datafusion/sqllogictest/test_files/order.slt
Original file line number Diff line number Diff line change
Expand Up @@ -778,15 +778,15 @@ physical_plan
08)--------------RepartitionExec: partitioning=RoundRobinBatch(2), input_partitions=1
09)----------------AggregateExec: mode=Partial, gby=[t@0 as t], aggr=[]
10)------------------ProjectionExec: expr=[column1@0 as t]
11)--------------------ValuesExec
11)--------------------ValuesExec [column1:Int64]
12)------ProjectionExec: expr=[1 as m, t@0 as t]
13)--------AggregateExec: mode=FinalPartitioned, gby=[t@0 as t], aggr=[]
14)----------CoalesceBatchesExec: target_batch_size=8192
15)------------RepartitionExec: partitioning=Hash([t@0], 2), input_partitions=2
16)--------------RepartitionExec: partitioning=RoundRobinBatch(2), input_partitions=1
17)----------------AggregateExec: mode=Partial, gby=[t@0 as t], aggr=[]
18)------------------ProjectionExec: expr=[column1@0 as t]
19)--------------------ValuesExec
19)--------------------ValuesExec [column1:Int64]

#####
# Multi column sorting with lists
Expand Down
6 changes: 3 additions & 3 deletions datafusion/sqllogictest/test_files/select.slt
Original file line number Diff line number Diff line change
Expand Up @@ -424,19 +424,19 @@ query TT
EXPLAIN VALUES (1, 'a', -1, 1.1),(NULL, 'b', -3, 0.5)
----
logical_plan Values: (Int64(1), Utf8("a"), Int64(-1), Float64(1.1)), (Int64(NULL), Utf8("b"), Int64(-3), Float64(0.5))
physical_plan ValuesExec
physical_plan ValuesExec [column1:Int64, column2:Utf8, column3:Int64, column4:Float64]

query TT
EXPLAIN VALUES ('1'::float)
----
logical_plan Values: (Float32(1) AS Utf8("1"))
physical_plan ValuesExec
physical_plan ValuesExec [column1:Float32]

query TT
EXPLAIN VALUES (('1'||'2')::int unsigned)
----
logical_plan Values: (UInt32(12) AS Utf8("1") || Utf8("2"))
physical_plan ValuesExec
physical_plan ValuesExec [column1:UInt32]


# all where empty
Expand Down
Loading