kosiew commented on code in PR #26133:
URL: https://github.com/apache/datafusion/pull/26133#discussion_r4247890221
##########
datafusion/physical-plan/src/sorts/partitioned_topk.rs:
##########
@@ -245,18 +261,40 @@ impl PartitionedTopKExec {
fetch: usize,
fn_kind: WindowFnKind,
) -> Result<Self> {
- let cache = Self::compute_properties(&input, expr.clone())?;
+ let cache =
+ Self::compute_properties(&input, expr.clone(),
partition_prefix_len, None)?;
Ok(Self {
input,
expr,
partition_prefix_len,
fetch,
fn_kind,
+ ranking_field: None,
metrics_set: ExecutionPlanMetricsSet::new(),
cache: Arc::new(cache),
})
}
+ /// Append `field` to the output, holding each retained row's value for
+ /// [`Self::fn_kind`]'s ranking function, so the caller can drop the
+ /// `BoundedWindowAggExec` that would otherwise compute it.
+ ///
+ /// The output schema widens by that one column, so the plan properties
+ /// are recomputed under it.
+ pub fn with_ranking_field(self, field: FieldRef) -> Result<Self> {
Review Comment:
The PR description still says `try_new` takes a new `ranking_field`
parameter and introduces a breaking API change, but its signature is unchanged.
Could you update the description to reflect the new `with_ranking_field`
builder and `ranking_field()` accessor, and replace the open question about
function-name matching with the implemented built-in equality check?
--
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]