Skip to content

Commit 67f541c

Browse files
adriangbclaude
andcommitted
refactor(optimizer): rename pinned_for_known_consumers
The name said the opposite of the doc comment. The method is for a projection that can stay in the plan for consumers that the caller can not see, so the consumers are the unknown ones. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
1 parent f3008a2 commit 67f541c

3 files changed

Lines changed: 5 additions & 5 deletions

File tree

‎datafusion/optimizer/src/extract_leaf_expressions.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ fn pinned_for_merge<'a>(
9292
direct_columns: &IndexSet<Column>,
9393
) -> PinnedDefinitions {
9494
let direct: Vec<Expr> = direct_columns.iter().cloned().map(Expr::Column).collect();
95-
inliner.pinned_for_known_consumers(inlined, &direct, DuplicationCost::Free)
95+
inliner.pinned_with_unknown_consumers(inlined, &direct, DuplicationCost::Free)
9696
}
9797

9898
/// Extracts `MoveTowardsLeafNodes` sub-expressions from non-projection nodes

‎datafusion/optimizer/src/projection_inliner.rs‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ impl<'a> ProjectionInliner<'a> {
231231
/// the caller can not see. A copy of a forbidden definition would then
232232
/// be evaluated independently of the original, and change the query
233233
/// result.
234-
pub(crate) fn pinned_for_known_consumers<'i, 'o>(
234+
pub(crate) fn pinned_with_unknown_consumers<'i, 'o>(
235235
&self,
236236
inlined: impl IntoIterator<Item = &'i Expr>,
237237
others: impl IntoIterator<Item = &'o Expr>,
@@ -506,7 +506,7 @@ mod tests {
506506
// Without all the consumers, a single reference is pinned as well.
507507
assert!(
508508
!inliner
509-
.pinned_for_known_consumers([&col("r")], no_others, max)
509+
.pinned_with_unknown_consumers([&col("r")], no_others, max)
510510
.is_empty()
511511
);
512512
}
@@ -525,7 +525,7 @@ mod tests {
525525
.is_not_null()
526526
.and(get_field_like(col("exp"), "x"));
527527
let other = col("cheap").gt(col("a"));
528-
let pinned = inliner.pinned_for_known_consumers(
528+
let pinned = inliner.pinned_with_unknown_consumers(
529529
[&twice, &other],
530530
no_others,
531531
DuplicationCost::Cheap,

‎datafusion/optimizer/src/push_down_filter.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1339,7 +1339,7 @@ fn rewrite_projection(
13391339
// optimizer instability: `ExtractLeafExpressions` undoes the push-down,
13401340
// which creates a loop that runs until the iteration limit is hit.
13411341
let no_other_consumers: [&Expr; 0] = [];
1342-
let pinned = inliner.pinned_for_known_consumers(
1342+
let pinned = inliner.pinned_with_unknown_consumers(
13431343
&predicates,
13441344
no_other_consumers,
13451345
DuplicationCost::Cheap,

0 commit comments

Comments
 (0)