andygrove commented on code in PR #2258:
URL: https://github.com/apache/datafusion-comet/pull/2258#discussion_r2369595848
##########
native/core/src/execution/planner.rs:
##########
@@ -2344,16 +2351,60 @@ impl PhysicalPlanner {
))
}
PartitioningStruct::RangePartition(range_partition) => {
+ // Generate the lexical ordering for comparisons
let exprs: Result<Vec<PhysicalSortExpr>, ExecutionError> =
range_partition
.sort_orders
.iter()
.map(|expr| self.create_sort_expr(expr,
Arc::clone(&input_schema)))
.collect();
let lex_ordering = LexOrdering::new(exprs?).unwrap();
+
+ // Generate the row converter for comparing incoming batches
to boundary rows
+ let sort_fields: Vec<SortField> = lex_ordering
+ .iter()
+ .map(|sort_expr| {
+ let data_type =
sort_expr.expr.data_type(input_schema.as_ref()).unwrap();
+ SortField::new_with_options(data_type,
sort_expr.options)
+ })
+ .collect();
Review Comment:
The `unwrap` can be avoided:
```suggestion
let sort_fields: Vec<SortField> = lex_ordering
.iter()
.map(|sort_expr| {
sort_expr
.expr
.data_type(input_schema.as_ref())
.map(|dt| SortField::new_with_options(dt,
sort_expr.options))
})
.collect::<Result<Vec<_>, _>>()?;
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]