Skip to content

Commit 5fbe713

Browse files
committed
fix proto serde
1 parent a2e108a commit 5fbe713

File tree

1 file changed

+13
-8
lines changed
  • datafusion/proto/src/logical_plan

1 file changed

+13
-8
lines changed

datafusion/proto/src/logical_plan/mod.rs

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff 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))

0 commit comments

Comments
 (0)