@@ -244,15 +244,21 @@ class ARROW_EXPORT TDigestReduceOptions : public FunctionOptions {
244244// / By default, returns the median value.
245245class ARROW_EXPORT TDigestQuantileOptions : public FunctionOptions {
246246 public:
247- explicit TDigestQuantileOptions (double q = 0.5 , uint32_t min_count = 0 );
248- explicit TDigestQuantileOptions (std::vector<double > q, uint32_t min_count = 0 );
247+ using Scaler = TDigestOptions::Scaler;
248+
249+ explicit TDigestQuantileOptions (double q = 0.5 , uint32_t min_count = 0 ,
250+ Scaler scaler = Scaler::K1);
251+ explicit TDigestQuantileOptions (std::vector<double > q, uint32_t min_count = 0 ,
252+ Scaler scaler = Scaler::K1);
249253 static constexpr char const kTypeName [] = " TDigestQuantileOptions" ;
250254 static TDigestQuantileOptions Defaults () { return TDigestQuantileOptions{}; }
251255
252256 // / probability level of quantile must be between 0 and 1 inclusive
253257 std::vector<double > q;
254258 // / If less than this many non-null values are observed, emit null.
255259 uint32_t min_count;
260+ // / select scaler implementation
261+ Scaler scaler;
256262};
257263
258264// / \brief Control Pivot kernel behavior
@@ -643,7 +649,7 @@ Result<Datum> TDigest(const Datum& value,
643649// / \brief Calculate centroids of a numeric array with T-Digest algorithm
644650// /
645651// / \param[in] value input datum, expecting Array or ChunkedArray
646- // / \param[in] options see TDigestOptions for more information
652+ // / \param[in] options see TDigestMapOptions for more information
647653// / \param[in] ctx the function execution context, optional
648654// / \return resulting struct of mean and weight arrays
649655// /
@@ -654,6 +660,36 @@ Result<Datum> TDigestMap(const Datum& value,
654660 const TDigestMapOptions& options = TDigestMapOptions::Defaults(),
655661 ExecContext* ctx = NULLPTR);
656662
663+ // / \brief Merge multiple centroid sets into one
664+ // /
665+ // / \param[in] value input centroid sets, expecting Scalar, Array or ChunkedArray of
666+ // / centroid structs \param[in] options see TDigestReduceOptions for more information
667+ // / \param[in] ctx the function execution context, optional
668+ // / \return resulting struct of mean and weight arrays
669+ // /
670+ // / \since 22.0.0
671+ // / \note API not yet finalized
672+ ARROW_EXPORT
673+ Result<Datum> TDigestReduce (
674+ const Datum& value,
675+ const TDigestReduceOptions& options = TDigestReduceOptions::Defaults(),
676+ ExecContext* ctx = NULLPTR);
677+
678+ // / \brief Calculate the approximate quantiles using centroids with T-Digest algorithm
679+ // /
680+ // / \param[in] value input centroid sets, expecting Scalar, Array or ChunkedArray of
681+ // / centroid structs \param[in] options see TDigestQuantileOptions for more information
682+ // / \param[in] ctx the function execution context, optional
683+ // / \return resulting struct of mean and weight arrays
684+ // /
685+ // / \since 22.0.0
686+ // / \note API not yet finalized
687+ ARROW_EXPORT
688+ Result<Datum> TDigestQuantile (
689+ const Datum& value,
690+ const TDigestQuantileOptions& options = TDigestQuantileOptions::Defaults(),
691+ ExecContext* ctx = NULLPTR);
692+
657693// / \brief Find the first index of a value in an array.
658694// /
659695// / \param[in] value The array to search.
0 commit comments