From 0946f652d1d90cfdcf4a9b50eaf17e839f459a3e Mon Sep 17 00:00:00 2001 From: Kevin H Wilson Date: Sun, 13 Oct 2024 16:29:57 -0400 Subject: [PATCH] update c++ docs on decimal aggregates --- docs/source/cpp/compute.rst | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/docs/source/cpp/compute.rst b/docs/source/cpp/compute.rst index 093b160d8e9a0..8301d384dfa77 100644 --- a/docs/source/cpp/compute.rst +++ b/docs/source/cpp/compute.rst @@ -171,8 +171,8 @@ To avoid exhaustively listing supported types, the tables below use a number of general type categories: * "Numeric": Integer types (Int8, etc.) and Floating-point types (Float32, - Float64, sometimes Float16). Some functions also accept Decimal128 and - Decimal256 input. + Float64, sometimes Float16). Some functions also accept + Decimal32/64/128/256 input. * "Temporal": Date types (Date32, Date64), Time types (Time32, Time64), Timestamp, Duration, Interval. @@ -256,7 +256,9 @@ the input to a single output value. is always -1, regardless of whether there are nulls in the input. * \(4) For decimal inputs, the resulting decimal will have the same - precision and scale. The result is rounded away from zero. + scale and the maximum precision for its width. For instance, an array + of ``decimal128(3, 2)`` will return a ``decimal128(38, 2)`` scalar. + The result is rounded away from zero. * \(5) Output is a ``{"min": input type, "max": input type}`` Struct. @@ -270,8 +272,10 @@ the input to a single output value. Note that the output can have less than *N* elements if the input has less than *N* distinct values. -* \(7) Output is Int64, UInt64, Float64, or Decimal128/256, depending on the - input type. +* \(7) Output is Int64, UInt64, Float64, or Decimal32/64/128/256, depending + on the input type. For decimals, the precision is increased to the maximum + precision for the type's width. For instance, an array of + ``decimal128(3, 2)`` will return a ``decimal128(38, 2)`` scalar. * \(8) Output is Float64 or input type, depending on QuantileOptions.