1515// specific language governing permissions and limitations
1616// under the License.
1717
18+ //! Probabilistic distributions for expression-level statistics (unused).
19+ //!
20+ //! Note: All public items in this module are **deprecated** as of `54.0.0`.
21+ //!
22+ //! See <https://github.com/apache/datafusion/pull/22071> for details.
23+
24+ // The whole module is deprecated; suppress warnings from intra-module uses
25+ // of the deprecated types so the module continues to compile.
26+ #![ allow( deprecated) ]
27+
1828use std:: f64:: consts:: LN_2 ;
1929
2030use crate :: interval_arithmetic:: { Interval , apply_operator} ;
@@ -37,6 +47,10 @@ use datafusion_common::{
3747/// is the main unit of calculus when evaluating expressions in a statistical
3848/// context. Notions like column and table statistics are built on top of this
3949/// object and the operations it supports.
50+ #[ deprecated(
51+ since = "54.0.0" ,
52+ note = "Part of the unused Statistics V2 framework; see https://github.com/apache/datafusion/pull/22071"
53+ ) ]
4054#[ derive( Clone , Debug , PartialEq ) ]
4155pub enum Distribution {
4256 Uniform ( UniformDistribution ) ,
@@ -214,6 +228,10 @@ impl Distribution {
214228///
215229/// <https://en.wikipedia.org/wiki/Continuous_uniform_distribution>
216230/// <https://en.wikipedia.org/wiki/Prior_probability#Improper_priors>
231+ #[ deprecated(
232+ since = "54.0.0" ,
233+ note = "Part of the unused Statistics V2 framework; see https://github.com/apache/datafusion/pull/22071"
234+ ) ]
217235#[ derive( Clone , Debug , PartialEq ) ]
218236pub struct UniformDistribution {
219237 interval : Interval ,
@@ -236,6 +254,10 @@ pub struct UniformDistribution {
236254/// For more information, see:
237255///
238256/// <https://en.wikipedia.org/wiki/Exponential_distribution>
257+ #[ deprecated(
258+ since = "54.0.0" ,
259+ note = "Part of the unused Statistics V2 framework; see https://github.com/apache/datafusion/pull/22071"
260+ ) ]
239261#[ derive( Clone , Debug , PartialEq ) ]
240262pub struct ExponentialDistribution {
241263 rate : ScalarValue ,
@@ -249,6 +271,10 @@ pub struct ExponentialDistribution {
249271/// For a more in-depth discussion, see:
250272///
251273/// <https://en.wikipedia.org/wiki/Normal_distribution>
274+ #[ deprecated(
275+ since = "54.0.0" ,
276+ note = "Part of the unused Statistics V2 framework; see https://github.com/apache/datafusion/pull/22071"
277+ ) ]
252278#[ derive( Clone , Debug , PartialEq ) ]
253279pub struct GaussianDistribution {
254280 mean : ScalarValue ,
@@ -259,6 +285,10 @@ pub struct GaussianDistribution {
259285/// the success probability is unknown. For a more in-depth discussion, see:
260286///
261287/// <https://en.wikipedia.org/wiki/Bernoulli_distribution>
288+ #[ deprecated(
289+ since = "54.0.0" ,
290+ note = "Part of the unused Statistics V2 framework; see https://github.com/apache/datafusion/pull/22071"
291+ ) ]
262292#[ derive( Clone , Debug , PartialEq ) ]
263293pub struct BernoulliDistribution {
264294 p : ScalarValue ,
@@ -268,6 +298,10 @@ pub struct BernoulliDistribution {
268298/// approximated via some summary statistics. For a more in-depth discussion, see:
269299///
270300/// <https://en.wikipedia.org/wiki/Summary_statistics>
301+ #[ deprecated(
302+ since = "54.0.0" ,
303+ note = "Part of the unused Statistics V2 framework; see https://github.com/apache/datafusion/pull/22071"
304+ ) ]
271305#[ derive( Clone , Debug , PartialEq ) ]
272306pub struct GenericDistribution {
273307 mean : ScalarValue ,
@@ -594,6 +628,10 @@ impl GenericDistribution {
594628/// This function takes a logical operator and two Bernoulli distributions,
595629/// and it returns a new Bernoulli distribution that represents the result of
596630/// the operation. Currently, only `AND` and `OR` operations are supported.
631+ #[ deprecated(
632+ since = "54.0.0" ,
633+ note = "Part of the unused Statistics V2 framework; see https://github.com/apache/datafusion/pull/22071"
634+ ) ]
597635pub fn combine_bernoullis (
598636 op : & Operator ,
599637 left : & BernoulliDistribution ,
@@ -649,6 +687,10 @@ pub fn combine_bernoullis(
649687/// see:
650688///
651689/// <https://en.wikipedia.org/wiki/Sum_of_normally_distributed_random_variables>
690+ #[ deprecated(
691+ since = "54.0.0" ,
692+ note = "Part of the unused Statistics V2 framework; see https://github.com/apache/datafusion/pull/22071"
693+ ) ]
652694pub fn combine_gaussians (
653695 op : & Operator ,
654696 left : & GaussianDistribution ,
@@ -673,6 +715,10 @@ pub fn combine_gaussians(
673715/// Expects `op` to be a comparison operator, with `left` and `right` having
674716/// numeric distributions. The resulting distribution has the `Float64` data
675717/// type.
718+ #[ deprecated(
719+ since = "54.0.0" ,
720+ note = "Part of the unused Statistics V2 framework; see https://github.com/apache/datafusion/pull/22071"
721+ ) ]
676722pub fn create_bernoulli_from_comparison (
677723 op : & Operator ,
678724 left : & Distribution ,
@@ -751,6 +797,10 @@ pub fn create_bernoulli_from_comparison(
751797/// given binary operation on two unknown quantities represented by their
752798/// [`Distribution`] objects. The function computes the mean, median and
753799/// variance if possible.
800+ #[ deprecated(
801+ since = "54.0.0" ,
802+ note = "Part of the unused Statistics V2 framework; see https://github.com/apache/datafusion/pull/22071"
803+ ) ]
754804pub fn new_generic_from_binary_op (
755805 op : & Operator ,
756806 left : & Distribution ,
@@ -766,6 +816,10 @@ pub fn new_generic_from_binary_op(
766816
767817/// Computes the mean value for the result of the given binary operation on
768818/// two unknown quantities represented by their [`Distribution`] objects.
819+ #[ deprecated(
820+ since = "54.0.0" ,
821+ note = "Part of the unused Statistics V2 framework; see https://github.com/apache/datafusion/pull/22071"
822+ ) ]
769823pub fn compute_mean (
770824 op : & Operator ,
771825 left : & Distribution ,
@@ -798,6 +852,10 @@ pub fn compute_mean(
798852/// the median is calculable only for addition and subtraction operations on:
799853/// - [`Uniform`] and [`Uniform`] distributions, and
800854/// - [`Gaussian`] and [`Gaussian`] distributions.
855+ #[ deprecated(
856+ since = "54.0.0" ,
857+ note = "Part of the unused Statistics V2 framework; see https://github.com/apache/datafusion/pull/22071"
858+ ) ]
801859pub fn compute_median (
802860 op : & Operator ,
803861 left : & Distribution ,
@@ -835,6 +893,10 @@ pub fn compute_median(
835893
836894/// Computes the variance value for the result of the given binary operation on
837895/// two unknown quantities represented by their [`Distribution`] objects.
896+ #[ deprecated(
897+ since = "54.0.0" ,
898+ note = "Part of the unused Statistics V2 framework; see https://github.com/apache/datafusion/pull/22071"
899+ ) ]
838900pub fn compute_variance (
839901 op : & Operator ,
840902 left : & Distribution ,
0 commit comments