File tree 2 files changed +8
-1
lines changed 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -218,7 +218,7 @@ impl LogicalPlanBuilder {
218
218
if values. is_empty ( ) {
219
219
return plan_err ! ( "Values list cannot be empty" ) ;
220
220
}
221
- let n_cols = values [ 0 ] . len ( ) ;
221
+ let n_cols = schema . fields ( ) . len ( ) ;
222
222
if n_cols == 0 {
223
223
return plan_err ! ( "Values list cannot be zero length" ) ;
224
224
}
Original file line number Diff line number Diff line change @@ -137,3 +137,10 @@ select 1 group by substr('');
137
137
# Error in filter should be reported
138
138
query error Divide by zero
139
139
SELECT c2 from aggregate_test_100 where CASE WHEN true THEN 1 / 0 ELSE 0 END = 1;
140
+
141
+
142
+ statement error DataFusion error: Error during planning: Inconsistent data length across values list: got 4 values in row 0 but expected 2
143
+ create table records (timestamp timestamp, value float) as values (
144
+ '2021-01-01 00:00:00', 1.0,
145
+ '2021-01-01 00:00:00', 2.0
146
+ );
You can’t perform that action at this time.
0 commit comments