You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@datafusion.apache.org by gi...@apache.org on 2026/09/17 02:23:54 UTC
(datafusion) branch asf-site updated: Publish built docs triggered by dcd385e3e1770cf2ee0d0ffd7e70f0d2175dd247
This is an automated email from the ASF dual-hosted git repository.
github-actions[bot] pushed a commit to branch asf-site
in repository https://gitbox.apache.org/repos/asf/datafusion.git
The following commit(s) were added to refs/heads/asf-site by this push:
new 2c1f56e603 Publish built docs triggered by dcd385e3e1770cf2ee0d0ffd7e70f0d2175dd247
2c1f56e603 is described below
commit 2c1f56e603a4c2998938d84557f71a9dcd3abdfc
Author: github-actions[bot] <gi...@users.noreply.github.com>
AuthorDate: Thu Sep 17 02:23:48 2026 +0000
Publish built docs triggered by dcd385e3e1770cf2ee0d0ffd7e70f0d2175dd247
---
.../library-user-guide/upgrading/56.0.0.md.txt | 33 ++++++++++++++++++++++
library-user-guide/upgrading/56.0.0.html | 32 +++++++++++++++++++++
searchindex.js | 2 +-
3 files changed, 66 insertions(+), 1 deletion(-)
diff --git a/_sources/library-user-guide/upgrading/56.0.0.md.txt b/_sources/library-user-guide/upgrading/56.0.0.md.txt
index 20cd0809ee..0a9828ff7f 100644
--- a/_sources/library-user-guide/upgrading/56.0.0.md.txt
+++ b/_sources/library-user-guide/upgrading/56.0.0.md.txt
@@ -394,3 +394,36 @@ let description = ChildFilterDescription::from_child_with_column_mapping(
&child,
)?;
```
+
+### `ensure_distribution` is deprecated in favour of `ensure_distribution_with_stats`
+
+`datafusion_physical_optimizer::enforce_distribution::ensure_distribution` now
+takes its `StatisticsContext` from the caller, so one context (and its
+memoization cache) can be shared across a whole bottom-up traversal. The old
+two-argument form is kept as a deprecated wrapper that allocates a fresh
+context per call, which recomputes each shared subtree's statistics once per
+ancestor.
+
+```rust,ignore
+// Before
+let plan = DistributionContext::new_default(plan)
+ .transform_up(|ctx| ensure_distribution(ctx, config))
+ .data()?;
+
+// After: one context for the whole walk. `StatsCache` is keyed by raw plan-node
+// pointers, so reset it whenever a node's plan pointer actually changed.
+let stats_ctx = StatisticsContext::new();
+let plan = DistributionContext::new_default(plan)
+ .transform_up(|ctx| {
+ let before = Arc::clone(&ctx.plan);
+ let result = ensure_distribution_with_stats(ctx, config, &stats_ctx)?;
+ if !Arc::ptr_eq(&before, &result.data.plan) {
+ stats_ctx.reset_cache();
+ }
+ Ok(result)
+ })
+ .data()?;
+```
+
+Callers that only need the previous behaviour can keep using the deprecated
+form, or pass a freshly constructed `StatisticsContext` per call.
diff --git a/library-user-guide/upgrading/56.0.0.html b/library-user-guide/upgrading/56.0.0.html
index 273ff90926..b0d7cc4154 100644
--- a/library-user-guide/upgrading/56.0.0.html
+++ b/library-user-guide/upgrading/56.0.0.html
@@ -788,6 +788,37 @@ filter on <code class="docutils literal notranslate"><span class="pre">a@0</
</pre></div>
</div>
</section>
+<section id="ensure-distribution-is-deprecated-in-favour-of-ensure-distribution-with-stats">
+<h3><code class="docutils literal notranslate"><span class="pre">ensure_distribution</span></code> is deprecated in favour of <code class="docutils literal notranslate"><span class="pre">ensure_distribution_with_stats</span></code><a class="headerlink" href="#ensure-distribution-is-deprecated-in-favour-of-ensure-distribution-with-stats" title="Link to this heading">#</a></h3>
+<p><code class="docutils literal notranslate"><span class="pre">datafusion_physical_optimizer::enforce_distribution::ensure_distribution</span></code> now
+takes its <code class="docutils literal notranslate"><span class="pre">StatisticsContext</span></code> from the caller, so one context (and its
+memoization cache) can be shared across a whole bottom-up traversal. The old
+two-argument form is kept as a deprecated wrapper that allocates a fresh
+context per call, which recomputes each shared subtree’s statistics once per
+ancestor.</p>
+<div class="highlight-rust notranslate"><div class="highlight"><pre><span></span><span class="c1">// Before</span>
+<span class="kd">let</span><span class="w"> </span><span class="n">plan</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">DistributionContext</span><span class="p">::</span><span class="n">new_default</span><span class="p">(</span><span class="n">plan</span><span class="p">)</span>
+<span class="w"> </span><span class="p">.</span><span class="n">transform_up</span><span class="p">(</span><span class="o">|</span><span class="n">ctx</span><span class="o">|</span><span class="w"> </span><span class="n">ensure_distribution</span><span class="p">(</span><span class="n">ctx</span><span class="p">,</span><span class="w"> </span><span class="n">config</span><span class="p">))</span>
+<span class="w"> </span><span class="p">.</span><span class="n">data</span><span class="p">()</span><span class="o">?</span><span class="p">;</span>
+
+<span class="c1">// After: one context for the whole walk. `StatsCache` is keyed by raw plan-node</span>
+<span class="c1">// pointers, so reset it whenever a node's plan pointer actually changed.</span>
+<span class="kd">let</span><span class="w"> </span><span class="n">stats_ctx</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">StatisticsContext</span><span class="p">::</span><span class="n">new</span><span class="p">();</span>
+<span class="kd">let</span><span class="w"> </span><span class="n">plan</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">DistributionContext</span><span class="p">::</span><span class="n">new_default</span><span class="p">(</span><span class="n">plan</span><span class="p">)</span>
+<span class="w"> </span><span class="p">.</span><span class="n">transform_up</span><span class="p">(</span><span class="o">|</span><span class="n">ctx</span><span class="o">|</span><span class="w"> </span><span class="p">{</span>
+<span class="w"> </span><span class="kd">let</span><span class="w"> </span><span class="n">before</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">Arc</span><span class="p">::</span><span class="n">clone</span><span class="p">(</span><span class="o">&</span><span class="n">ctx</span><span class="p">.</span><span class="n">plan</span><span class="p">);</span>
+<span class="w"> </span><span class="kd">let</span><span class="w"> </span><span class="n">result</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">ensure_distribution_with_stats</span><span class="p">(</span><span class="n">ctx</span><span class="p">,</span><span class="w"> </span><span class="n">config</span><span class="p">,</span><span class="w"> </span><span class="o">&</span><span class="n">stats_ctx</span><span class="p">)</sp [...]
+<span class="w"> </span><span class="k">if</span><span class="w"> </span><span class="o">!</span><span class="n">Arc</span><span class="p">::</span><span class="n">ptr_eq</span><span class="p">(</span><span class="o">&</span><span class="n">before</span><span class="p">,</span><span class="w"> </span><span class="o">&</span><span class="n">result</span><span class="p">.</span><span class="n">data</span><span class="p">.</span><span class="n">plan</span><span class="p">)</s [...]
+<span class="w"> </span><span class="n">stats_ctx</span><span class="p">.</span><span class="n">reset_cache</span><span class="p">();</span>
+<span class="w"> </span><span class="p">}</span>
+<span class="w"> </span><span class="nb">Ok</span><span class="p">(</span><span class="n">result</span><span class="p">)</span>
+<span class="w"> </span><span class="p">})</span>
+<span class="w"> </span><span class="p">.</span><span class="n">data</span><span class="p">()</span><span class="o">?</span><span class="p">;</span>
+</pre></div>
+</div>
+<p>Callers that only need the previous behaviour can keep using the deprecated
+form, or pass a freshly constructed <code class="docutils literal notranslate"><span class="pre">StatisticsContext</span></code> per call.</p>
+</section>
</section>
</section>
@@ -853,6 +884,7 @@ filter on <code class="docutils literal notranslate"><span class="pre">a@0</
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#map-extract-element-at-return-an-empty-list-for-absent-keys"><code class="docutils literal notranslate"><span class="pre">map_extract</span></code> / <code class="docutils literal notranslate"><span class="pre">element_at</span></code> return an empty list for absent keys</a></li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#dataframe-from-columns-accepts-intoiterator"><code class="docutils literal notranslate"><span class="pre">DataFrame::from_columns</span></code> accepts <code class="docutils literal notranslate"><span class="pre">IntoIterator</span></code></a></li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#physical-filter-pushdown-resolves-columns-by-position">Physical filter pushdown resolves columns by position</a></li>
+<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#ensure-distribution-is-deprecated-in-favour-of-ensure-distribution-with-stats"><code class="docutils literal notranslate"><span class="pre">ensure_distribution</span></code> is deprecated in favour of <code class="docutils literal notranslate"><span class="pre">ensure_distribution_with_stats</span></code></a></li>
</ul>
</li>
</ul>
diff --git a/searchindex.js b/searchindex.js
index 3ab1935f13..d82b9bebe2 100644
--- a/searchindex.js
+++ b/searchindex.js
@@ -1 +1 @@
-Search.setIndex({"alltitles":{"!=":[[77,"op-neq"]],"!~":[[77,"op-re-not-match"]],"!~*":[[77,"op-re-not-match-i"]],"!~~":[[77,"id19"]],"!~~*":[[77,"id20"]],"#":[[77,"op-bit-xor"]],"%":[[77,"op-modulo"]],"&":[[77,"op-bit-and"]],"(relation, name) tuples in logical fields and logical columns are unique":[[16,"relation-name-tuples-in-logical-fields-and-logical-columns-are-unique"]],"*":[[77,"op-multiply"]],"+":[[77,"op-plus"]],"-":[[77,"op-minus"]],"/":[[77,"op-divide"]],"1. Array Literal Con [...]
\ No newline at end of file
+Search.setIndex({"alltitles":{"!=":[[77,"op-neq"]],"!~":[[77,"op-re-not-match"]],"!~*":[[77,"op-re-not-match-i"]],"!~~":[[77,"id19"]],"!~~*":[[77,"id20"]],"#":[[77,"op-bit-xor"]],"%":[[77,"op-modulo"]],"&":[[77,"op-bit-and"]],"(relation, name) tuples in logical fields and logical columns are unique":[[16,"relation-name-tuples-in-logical-fields-and-logical-columns-are-unique"]],"*":[[77,"op-multiply"]],"+":[[77,"op-plus"]],"-":[[77,"op-minus"]],"/":[[77,"op-divide"]],"1. Array Literal Con [...]
\ No newline at end of file
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@datafusion.apache.org
For additional commands, e-mail: commits-help@datafusion.apache.org