File tree Expand file tree Collapse file tree 1 file changed +13
-8
lines changed
datafusion/proto/src/logical_plan Expand file tree Collapse file tree 1 file changed +13
-8
lines changed Original file line number Diff line number Diff line change @@ -495,12 +495,14 @@ impl AsLogicalPlan for LogicalPlanNode {
495495 projection = Some ( column_indices) ;
496496 }
497497
498- let ordering = scan. ordering . as_ref ( ) . map ( |o| {
499- o. preferred_ordering
500- . as_ref ( )
501- . map ( |so| from_proto:: parse_sorts ( & so. sort_expr_nodes , ctx, extension_codec) )
502- . transpose ( )
503- } ) . transpose ( ) ?;
498+ let ordering = scan
499+ . ordering
500+ . as_ref ( )
501+ . and_then ( |o| o. preferred_ordering . as_ref ( ) )
502+ . map ( |so| {
503+ from_proto:: parse_sorts ( & so. sort_expr_nodes , ctx, extension_codec)
504+ } )
505+ . transpose ( ) ?;
504506
505507 let mut scan = TableScan :: try_new (
506508 table_name,
@@ -509,8 +511,11 @@ impl AsLogicalPlan for LogicalPlanNode {
509511 filters,
510512 None ,
511513 ) ?;
512- if let Some ( ordering) = ordering {
513- scan = scan. with_ordering ( ordering) ;
514+ if let Some ( preferred_ordering) = ordering {
515+ let scan_ordering = datafusion_expr:: logical_plan:: ScanOrdering {
516+ preferred_ordering : Some ( preferred_ordering) ,
517+ } ;
518+ scan = scan. with_ordering ( scan_ordering) ;
514519 }
515520
516521 Ok ( LogicalPlan :: TableScan ( scan) )
You can’t perform that action at this time.
0 commit comments