Skip to content

Commit 16bdac4

Browse files
authored
Apply suggestions from code review
1 parent 247d5fe commit 16bdac4

File tree

3 files changed

+7
-9
lines changed

3 files changed

+7
-9
lines changed

datafusion/physical-expr/src/aggregate.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,8 @@ use crate::expressions::Column;
4242

4343
use arrow::datatypes::{DataType, Field, Schema, SchemaRef};
4444
use arrow_schema::SortOptions;
45-
use datafusion_common::ScalarValue;
46-
use datafusion_common::{internal_err, not_impl_err, Result};
47-
use datafusion_expr::ReversedUDAF;
48-
use datafusion_expr::{AggregateExprSetMonotonicity, AggregateUDF};
45+
use datafusion_common::{internal_err, not_impl_err, ScalarValue, Result};
46+
use datafusion_expr::{AggregateExprSetMonotonicity, AggregateUDF, ReversedUDAF};
4947
use datafusion_expr_common::accumulator::Accumulator;
5048
use datafusion_expr_common::groups_accumulator::GroupsAccumulator;
5149
use datafusion_expr_common::type_coercion::aggregates::check_arg_count;
@@ -547,7 +545,7 @@ impl AggregateFunctionExpr {
547545
self.fun.inner().set_monotonicity(data_type)
548546
}
549547

550-
/// Returns PhysicalSortExpr based on monotonicity of the function
548+
/// Returns `PhysicalSortExpr` based on the set monotonicity of the function.
551549
pub fn get_result_ordering(&self, aggr_func_idx: usize) -> Option<PhysicalSortExpr> {
552550
// If the aggregate expressions are set-monotonic, the output data is
553551
// naturally ordered with it per group or partition.

datafusion/physical-expr/src/window/aggregate.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,7 @@ use crate::{reverse_order_bys, EquivalenceProperties, PhysicalExpr};
3232
use arrow::array::Array;
3333
use arrow::record_batch::RecordBatch;
3434
use arrow::{array::ArrayRef, datatypes::Field};
35-
use datafusion_common::ScalarValue;
36-
use datafusion_common::{DataFusionError, Result};
35+
use datafusion_common::{DataFusionError, ScalarValue, Result};
3736
use datafusion_expr::{Accumulator, WindowFrame};
3837
use datafusion_physical_expr_common::sort_expr::LexOrdering;
3938

datafusion/physical-expr/src/window/standard.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ impl StandardWindowExpr {
6565
&self.expr
6666
}
6767

68-
/// Adds any equivalent orderings generated by the `self.expr` to `builder`.
68+
/// Adds any equivalent orderings generated by `self.expr` to `builder`.
6969
///
7070
/// If `self.expr` doesn't have an ordering, ordering equivalence properties
7171
/// are not updated. Otherwise, ordering equivalence properties are updated
@@ -270,7 +270,8 @@ impl WindowExpr for StandardWindowExpr {
270270
}
271271
}
272272

273-
/// Adds new ordering expression into the existing ordering equivalence class based on partition by information.
273+
/// Adds a new ordering expression into existing ordering equivalence class(es) based on
274+
/// PARTITION BY information (if it exists).
274275
pub(crate) fn add_new_ordering_expr_with_partition_by(
275276
eqp: &mut EquivalenceProperties,
276277
expr: PhysicalSortExpr,

0 commit comments

Comments
 (0)