File tree Expand file tree Collapse file tree 2 files changed +12
-6
lines changed Expand file tree Collapse file tree 2 files changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -1450,20 +1450,19 @@ impl<S: ContextProvider> SqlToRel<'_, S> {
1450
1450
ordered_expr,
1451
1451
schema,
1452
1452
planner_context,
1453
- )
1454
- . unwrap ( ) ;
1453
+ ) ?;
1455
1454
let asc = order_by_expr. options . asc . unwrap_or ( true ) ;
1456
1455
let nulls_first =
1457
1456
order_by_expr. options . nulls_first . unwrap_or_else ( || {
1458
1457
self . options . default_null_ordering . nulls_first ( asc)
1459
1458
} ) ;
1460
1459
1461
- SortExpr :: new ( ordered_expr, asc, nulls_first)
1460
+ Ok ( SortExpr :: new ( ordered_expr, asc, nulls_first) )
1462
1461
} )
1463
- . collect :: < Vec < SortExpr > > ( ) ;
1464
- result
1462
+ . collect :: < Result < Vec < SortExpr > > > ( ) ? ;
1463
+ Ok ( result)
1465
1464
} )
1466
- . collect :: < Vec < Vec < SortExpr > > > ( ) ;
1465
+ . collect :: < Result < Vec < Vec < SortExpr > > > > ( ) ? ;
1467
1466
1468
1467
return Ok ( results) ;
1469
1468
}
Original file line number Diff line number Diff line change @@ -766,6 +766,13 @@ physical_plan DataSourceExec: file_groups={1 group: [[WORKSPACE_ROOT/datafusion/
766
766
query error DataFusion error: Error during planning: Column a is not in schema
767
767
CREATE EXTERNAL TABLE dt (a_id integer, a_str string, a_bool boolean) STORED AS CSV WITH ORDER (a ASC) LOCATION 'file://path/to/table';
768
768
769
+
770
+ # Create external table with order column expression that can't be planned
771
+ # This is currently expected to fail, but should not panic
772
+ query error DataFusion error: Schema error: No field named a\.
773
+ CREATE EXTERNAL TABLE dt STORED AS CSV WITH ORDER (a || b) LOCATION 'file://path/to/table';
774
+
775
+
769
776
# Sort with duplicate sort expressions
770
777
# Table is sorted multiple times on the same column name and should not fail
771
778
statement ok
You can’t perform that action at this time.
0 commit comments