You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "js8544 (via GitHub)" <gi...@apache.org> on 2023/07/28 14:56:53 UTC
[GitHub] [arrow] js8544 opened a new pull request, #36932: GH-36931: [C++] Add cumulative_mean function
js8544 opened a new pull request, #36932:
URL: https://github.com/apache/arrow/pull/36932
<!--
Thanks for opening a pull request!
If this is your first pull request you can find detailed information on how
to contribute here:
* [New Contributor's Guide](https://arrow.apache.org/docs/dev/developers/guide/step_by_step/pr_lifecycle.html#reviews-and-merge-of-the-pull-request)
* [Contributing Overview](https://arrow.apache.org/docs/dev/developers/overview.html)
If this is not a [minor PR](https://github.com/apache/arrow/blob/main/CONTRIBUTING.md#Minor-Fixes). Could you open an issue for this pull request on GitHub? https://github.com/apache/arrow/issues/new/choose
Opening GitHub issues ahead of time contributes to the [Openness](http://theapacheway.com/open/#:~:text=Openness%20allows%20new%20users%20the,must%20happen%20in%20the%20open.) of the Apache Arrow project.
Then could you also rename the pull request title in the following format?
GH-${GITHUB_ISSUE_ID}: [${COMPONENT}] ${SUMMARY}
or
MINOR: [${COMPONENT}] ${SUMMARY}
In the case of PARQUET issues on JIRA the title also supports:
PARQUET-${JIRA_ISSUE_ID}: [${COMPONENT}] ${SUMMARY}
-->
### Rationale for this change
<!--
Why are you proposing this change? If this is already explained clearly in the issue then this section is not needed.
Explaining clearly why changes are proposed helps reviewers understand your changes and offer better suggestions for fixes.
-->
Add `cumulative_mean` function
### What changes are included in this PR?
<!--
There is no need to duplicate the description in the issue here but it is sometimes worth providing a summary of the individual changes in this PR.
-->
Implement `cumulative_mean` function. The current cumulative_* kernel generator can only be based on a simple binary arithmetic op and the state can only be a single value. I refactored it to using of a generic state such that it can handle complex operations such as `mean`, `median`, `var` etc.
### Are these changes tested?
<!--
We typically require tests for all PRs in order to:
1. Prevent the code from being accidentally broken by subsequent changes
3. Serve as another way to document the expected behavior of the code
If tests are not included in your PR, please explain why (for example, are they covered by existing tests)?
-->
Yes
### Are there any user-facing changes?
No
<!--
If there are user-facing changes then we may require documentation to be updated before approving the PR.
-->
<!--
If there are any breaking changes to public APIs, please uncomment the line below and explain which changes are breaking.
-->
<!-- **This PR includes breaking changes to public APIs.** -->
<!--
Please uncomment the line below (and provide explanation) if the changes fix either (a) a security vulnerability, (b) a bug that caused incorrect or invalid data to be produced, or (c) a bug that causes a crash (even when the API contract is upheld). We use this to highlight fixes to issues that may affect users without their knowledge. For this reason, fixing bugs that cause errors don't count, since those are usually obvious.
-->
<!-- **This PR contains a "Critical Fix".** -->
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow] js8544 commented on a diff in pull request #36932: GH-36931: [C++] Add cumulative_mean function
Posted by "js8544 (via GitHub)" <gi...@apache.org>.
js8544 commented on code in PR #36932:
URL: https://github.com/apache/arrow/pull/36932#discussion_r1288501904
##########
cpp/src/arrow/compute/kernels/vector_cumulative_ops.cc:
##########
@@ -217,53 +253,142 @@ const FunctionDoc cumulative_min_doc{
"start as the new minimum)."),
{"values"},
"CumulativeOptions"};
+
+const FunctionDoc cumulative_mean_doc{
+ "Compute the cumulative mean over a numeric input",
+ ("`values` must be numeric. Return an array/chunked array which is the\n"
+ "cumulative mean computed over `values`. CumulativeOptions::start_value is \n"
+ "ignored."),
+ {"values"},
+ "CumulativeOptions"};
} // namespace
+// Kernel factory for simple arithmetic operations.
+// Op is a compute kernel representing any binary associative operation with
+// an identity element (add, product, min, max, etc.), i.e. ones that form a monoid.
+template <typename Op, typename OptionsType>
+struct CumulativeBinaryOpKernelFactory {
Review Comment:
Thanks! This is a `Today I Learned` for me.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow] github-actions[bot] commented on pull request #36932: GH-36931: [C++] Add cumulative_mean function
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #36932:
URL: https://github.com/apache/arrow/pull/36932#issuecomment-1655838995
:warning: GitHub issue #36931 **has been automatically assigned in GitHub** to PR creator.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow] pitrou commented on a diff in pull request #36932: GH-36931: [C++] Add cumulative_mean function
Posted by "pitrou (via GitHub)" <gi...@apache.org>.
pitrou commented on code in PR #36932:
URL: https://github.com/apache/arrow/pull/36932#discussion_r1288517725
##########
cpp/src/arrow/compute/kernels/vector_cumulative_ops.cc:
##########
@@ -217,53 +253,102 @@ const FunctionDoc cumulative_min_doc{
"start as the new minimum)."),
{"values"},
"CumulativeOptions"};
-} // namespace
-template <typename Op, typename OptionsType>
-void MakeVectorCumulativeFunction(FunctionRegistry* registry, const std::string func_name,
- const FunctionDoc doc) {
+const FunctionDoc cumulative_mean_doc{
+ "Compute the cumulative mean over a numeric input",
+ ("`values` must be numeric. Return an array/chunked array which is the\n"
+ "cumulative mean computed over `values`. CumulativeOptions::start_value is \n"
+ "ignored."),
+ {"values"},
+ "CumulativeOptions"};
+
+// Kernel factory for complex stateful computations.
+template <template <typename ArgType> typename State, typename OptionsType>
+struct CumulativeStatefulKernelFactory {
+ VectorKernel kernel;
+
+ CumulativeStatefulKernelFactory() {
+ kernel.can_execute_chunkwise = false;
+ kernel.null_handling = NullHandling::type::COMPUTED_NO_PREALLOCATE;
+ kernel.mem_allocation = MemAllocation::type::NO_PREALLOCATE;
+ kernel.init = CumulativeOptionsWrapper<OptionsType>::Init;
+ }
+
+ template <typename Type>
+ enable_if_number<Type, Status> Visit(const Type& type) {
+ kernel.signature = KernelSignature::Make(
+ {type.GetSharedPtr()},
+ OutputType(TypeTraits<typename State<Type>::OutType>::type_singleton()));
+ kernel.exec = CumulativeKernel<Type, State<Type>, OptionsType>::Exec;
+ kernel.exec_chunked = CumulativeKernelChunked<Type, State<Type>, OptionsType>::Exec;
+ return arrow::Status::OK();
+ }
+
+ Status Visit(const DataType& type) {
+ return Status::NotImplemented("Cumulative kernel not implemented for type ",
+ type.ToString());
+ }
+
+ Result<VectorKernel> Make(const DataType& type) {
+ RETURN_NOT_OK(VisitTypeInline(type, this));
+ return kernel;
+ }
+};
+
+template <template <typename ArgType> typename State, typename OptionsType>
+void MakeVectorCumulativeStatefulFunction(FunctionRegistry* registry,
+ const std::string func_name,
+ const FunctionDoc doc) {
static const OptionsType kDefaultOptions = OptionsType::Defaults();
auto func =
std::make_shared<VectorFunction>(func_name, Arity::Unary(), doc, &kDefaultOptions);
std::vector<std::shared_ptr<DataType>> types;
types.insert(types.end(), NumericTypes().begin(), NumericTypes().end());
+ CumulativeStatefulKernelFactory<State, OptionsType> kernel_factory;
for (const auto& ty : types) {
- VectorKernel kernel;
- kernel.can_execute_chunkwise = false;
- kernel.null_handling = NullHandling::type::COMPUTED_NO_PREALLOCATE;
- kernel.mem_allocation = MemAllocation::type::NO_PREALLOCATE;
- kernel.signature = KernelSignature::Make({ty}, OutputType(ty));
- kernel.exec =
- ArithmeticExecFromOp<CumulativeKernel, Op, ArrayKernelExec, OptionsType>(ty);
- kernel.exec_chunked =
- ArithmeticExecFromOp<CumulativeKernelChunked, Op, VectorKernel::ChunkedExec,
- OptionsType>(ty);
- kernel.init = CumulativeOptionsWrapper<OptionsType>::Init;
+ auto kernel = kernel_factory.Make(*ty).ValueOrDie();
DCHECK_OK(func->AddKernel(std::move(kernel)));
}
DCHECK_OK(registry->AddFunction(std::move(func)));
}
+// A kernel factory that forwards to CumulativeBinaryOp<Op, ...> for the given type.
+// Need to use a struct because template-using declarations cannot appear in
+// function scope.
+template <typename Op, typename OptionsType>
+struct MakeVectorCumulativeBinaryOpFunction {
+ template <typename ArgType>
+ using State = CumulativeBinaryOp<Op, ArgType>;
+
+ static void Call(FunctionRegistry* registry, std::string func_name, FunctionDoc doc) {
+ MakeVectorCumulativeStatefulFunction<State, OptionsType>(
+ registry, std::move(func_name), std::move(doc));
+ }
+};
Review Comment:
@bkietz Can you think of a more straightforward way to do this?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow] js8544 commented on a diff in pull request #36932: GH-36931: [C++] Add cumulative_mean function
Posted by "js8544 (via GitHub)" <gi...@apache.org>.
js8544 commented on code in PR #36932:
URL: https://github.com/apache/arrow/pull/36932#discussion_r1288446127
##########
cpp/src/arrow/compute/kernels/vector_cumulative_ops.cc:
##########
@@ -217,53 +253,142 @@ const FunctionDoc cumulative_min_doc{
"start as the new minimum)."),
{"values"},
"CumulativeOptions"};
+
+const FunctionDoc cumulative_mean_doc{
+ "Compute the cumulative mean over a numeric input",
+ ("`values` must be numeric. Return an array/chunked array which is the\n"
+ "cumulative mean computed over `values`. CumulativeOptions::start_value is \n"
+ "ignored."),
+ {"values"},
+ "CumulativeOptions"};
} // namespace
+// Kernel factory for simple arithmetic operations.
+// Op is a compute kernel representing any binary associative operation with
+// an identity element (add, product, min, max, etc.), i.e. ones that form a monoid.
+template <typename Op, typename OptionsType>
+struct CumulativeBinaryOpKernelFactory {
Review Comment:
This unfortunately cannot be done easily.
```
template <typename ArgType> State = CumulativeBinaryOp<Op, ArgType>
```
This line won't work because `CumulativeBinaryOp<Op, ArgType>` is not a template anymore (both template parameters are fulfilled). We need to have some kind of currying mechanism for templates to make `CumulativeBinaryOp<Op, ArgType>` match `template <typename ArgType> State`. I'll really appreciate some help from a C++ metaprogramming expert :).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow] pitrou merged pull request #36932: GH-36931: [C++] Add cumulative_mean function
Posted by "pitrou (via GitHub)" <gi...@apache.org>.
pitrou merged PR #36932:
URL: https://github.com/apache/arrow/pull/36932
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow] pitrou commented on a diff in pull request #36932: GH-36931: [C++] Add cumulative_mean function
Posted by "pitrou (via GitHub)" <gi...@apache.org>.
pitrou commented on code in PR #36932:
URL: https://github.com/apache/arrow/pull/36932#discussion_r1288498544
##########
cpp/src/arrow/compute/kernels/vector_cumulative_ops.cc:
##########
@@ -217,53 +253,142 @@ const FunctionDoc cumulative_min_doc{
"start as the new minimum)."),
{"values"},
"CumulativeOptions"};
+
+const FunctionDoc cumulative_mean_doc{
+ "Compute the cumulative mean over a numeric input",
+ ("`values` must be numeric. Return an array/chunked array which is the\n"
+ "cumulative mean computed over `values`. CumulativeOptions::start_value is \n"
+ "ignored."),
+ {"values"},
+ "CumulativeOptions"};
} // namespace
+// Kernel factory for simple arithmetic operations.
+// Op is a compute kernel representing any binary associative operation with
+// an identity element (add, product, min, max, etc.), i.e. ones that form a monoid.
+template <typename Op, typename OptionsType>
+struct CumulativeBinaryOpKernelFactory {
Review Comment:
I've pushed a solution. Not as pretty as I'd hoped, but it still works and spares the repetition.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow] js8544 commented on a diff in pull request #36932: GH-36931: [C++] Add cumulative_mean function
Posted by "js8544 (via GitHub)" <gi...@apache.org>.
js8544 commented on code in PR #36932:
URL: https://github.com/apache/arrow/pull/36932#discussion_r1288439634
##########
cpp/src/arrow/compute/kernels/vector_cumulative_ops.cc:
##########
@@ -217,53 +253,142 @@ const FunctionDoc cumulative_min_doc{
"start as the new minimum)."),
{"values"},
"CumulativeOptions"};
+
+const FunctionDoc cumulative_mean_doc{
+ "Compute the cumulative mean over a numeric input",
+ ("`values` must be numeric. Return an array/chunked array which is the\n"
+ "cumulative mean computed over `values`. CumulativeOptions::start_value is \n"
+ "ignored."),
+ {"values"},
+ "CumulativeOptions"};
} // namespace
Review Comment:
Done
##########
cpp/src/arrow/compute/api_vector.h:
##########
@@ -661,6 +661,16 @@ Result<Datum> CumulativeMin(
const Datum& values, const CumulativeOptions& options = CumulativeOptions::Defaults(),
ExecContext* ctx = NULLPTR);
+/// \brief Compute the cumulative mean of an array-like object
+///
Review Comment:
I added in both
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow] pitrou commented on a diff in pull request #36932: GH-36931: [C++] Add cumulative_mean function
Posted by "pitrou (via GitHub)" <gi...@apache.org>.
pitrou commented on code in PR #36932:
URL: https://github.com/apache/arrow/pull/36932#discussion_r1288111862
##########
cpp/src/arrow/compute/kernels/vector_cumulative_ops.cc:
##########
@@ -217,53 +253,142 @@ const FunctionDoc cumulative_min_doc{
"start as the new minimum)."),
{"values"},
"CumulativeOptions"};
+
+const FunctionDoc cumulative_mean_doc{
+ "Compute the cumulative mean over a numeric input",
+ ("`values` must be numeric. Return an array/chunked array which is the\n"
+ "cumulative mean computed over `values`. CumulativeOptions::start_value is \n"
+ "ignored."),
+ {"values"},
+ "CumulativeOptions"};
} // namespace
Review Comment:
The anonymous namespace could encompass more symbols, for example below.
##########
cpp/src/arrow/compute/api_vector.h:
##########
@@ -661,6 +661,16 @@ Result<Datum> CumulativeMin(
const Datum& values, const CumulativeOptions& options = CumulativeOptions::Defaults(),
ExecContext* ctx = NULLPTR);
+/// \brief Compute the cumulative mean of an array-like object
+///
Review Comment:
Can you note that the start_value option is ignored?
##########
cpp/src/arrow/compute/kernels/vector_cumulative_ops.cc:
##########
@@ -217,53 +253,142 @@ const FunctionDoc cumulative_min_doc{
"start as the new minimum)."),
{"values"},
"CumulativeOptions"};
+
+const FunctionDoc cumulative_mean_doc{
+ "Compute the cumulative mean over a numeric input",
+ ("`values` must be numeric. Return an array/chunked array which is the\n"
+ "cumulative mean computed over `values`. CumulativeOptions::start_value is \n"
+ "ignored."),
+ {"values"},
+ "CumulativeOptions"};
} // namespace
+// Kernel factory for simple arithmetic operations.
+// Op is a compute kernel representing any binary associative operation with
+// an identity element (add, product, min, max, etc.), i.e. ones that form a monoid.
+template <typename Op, typename OptionsType>
+struct CumulativeBinaryOpKernelFactory {
Review Comment:
Would something like this work instead:
```c++
// A cumulative kernel factory that forwards to CumulativeBinaryOp<Op, ...> for the given type
template <typename Op, typename OptionsType,
template <typename ArgType> State = CumulativeBinaryOp<Op, ArgType>>
using CumulativeBinaryOpKernelFactory = CumulativeStatefulKernelFactory<State, OptionsType>;
```
##########
cpp/src/arrow/compute/kernels/vector_cumulative_ops_test.cc:
##########
@@ -37,19 +37,23 @@
namespace arrow {
namespace compute {
-constexpr static std::array<const char*, 6> kCumulativeFunctionNames{
+constexpr static std::array<const char*, 7> kCumulativeFunctionNames{
Review Comment:
Since we are changing this, can we simply make this a `std::vector<std::string>`? It will make further maintenance easier.
##########
cpp/src/arrow/compute/api_vector.h:
##########
@@ -661,6 +661,16 @@ Result<Datum> CumulativeMin(
const Datum& values, const CumulativeOptions& options = CumulativeOptions::Defaults(),
ExecContext* ctx = NULLPTR);
+/// \brief Compute the cumulative mean of an array-like object
+///
Review Comment:
Or add it in the `CumulativeOptions` docs instead.
##########
docs/source/cpp/compute.rst:
##########
@@ -1621,21 +1621,23 @@ do not detect overflow. They are alsoavailable in an overflow-checking variant,
suffixed ``_checked``, which returns an ``Invalid`` :class:`Status` when
overflow is detected.
-+------------------------+-------+-------------+-------------+--------------------------------+-------+
-| Function name | Arity | Input types | Output type | Options class | Notes |
-+=========================+=======+=============+=============+================================+=======+
-| cumulative_sum | Unary | Numeric | Numeric | :struct:`CumulativeOptions` | \(1) |
-+-------------------------+-------+-------------+-------------+--------------------------------+-------+
-| cumulative_sum_checked | Unary | Numeric | Numeric | :struct:`CumulativeOptions` | \(1) |
-+-------------------------+-------+-------------+-------------+--------------------------------+-------+
-| cumulative_prod | Unary | Numeric | Numeric | :struct:`CumulativeOptions` | \(1) |
-+-------------------------+-------+-------------+-------------+--------------------------------+-------+
-| cumulative_prod_checked | Unary | Numeric | Numeric | :struct:`CumulativeOptions` | \(1) |
-+-------------------------+-------+-------------+-------------+--------------------------------+-------+
-| cumulative_max | Unary | Numeric | Numeric | :struct:`CumulativeOptions` | \(1) |
-+-------------------------+-------+-------------+-------------+--------------------------------+-------+
-| cumulative_min | Unary | Numeric | Numeric | :struct:`CumulativeOptions` | \(1) |
-+-------------------------+-------+-------------+-------------+--------------------------------+-------+
++-------------------------+-------+-------------+-------------+--------------------------------+-----------+
+| Function name | Arity | Input types | Output type | Options class | Notes |
++=========================+=======+=============+=============+================================+===========+
+| cumulative_sum | Unary | Numeric | Numeric | :struct:`CumulativeOptions` | \(1) |
++-------------------------+-------+-------------+-------------+--------------------------------+-----------+
+| cumulative_sum_checked | Unary | Numeric | Numeric | :struct:`CumulativeOptions` | \(1) |
++-------------------------+-------+-------------+-------------+--------------------------------+-----------+
+| cumulative_prod | Unary | Numeric | Numeric | :struct:`CumulativeOptions` | \(1) |
++-------------------------+-------+-------------+-------------+--------------------------------+-----------+
+| cumulative_prod_checked | Unary | Numeric | Numeric | :struct:`CumulativeOptions` | \(1) |
++-------------------------+-------+-------------+-------------+--------------------------------+-----------+
+| cumulative_max | Unary | Numeric | Numeric | :struct:`CumulativeOptions` | \(1) |
++-------------------------+-------+-------------+-------------+--------------------------------+-----------+
+| cumulative_min | Unary | Numeric | Numeric | :struct:`CumulativeOptions` | \(1) |
++-------------------------+-------+-------------+-------------+--------------------------------+-----------+
+| cumulative_mean | Unary | Numeric | Double | :struct:`CumulativeOptions` | \(1) \(2) |
Review Comment:
We use "Float64" not "Double" here.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow] conbench-apache-arrow[bot] commented on pull request #36932: GH-36931: [C++] Add cumulative_mean function
Posted by "conbench-apache-arrow[bot] (via GitHub)" <gi...@apache.org>.
conbench-apache-arrow[bot] commented on PR #36932:
URL: https://github.com/apache/arrow/pull/36932#issuecomment-1676187372
After merging your PR, Conbench analyzed the 6 benchmarking runs that have been run so far on merge-commit 6e6e6f0340672ed49fb8e7cddf7bc47f2ca360dd.
There were no benchmark performance regressions. 🎉
The [full Conbench report](https://github.com/apache/arrow/runs/15848191211) has more details. It also includes information about possible false positives for unstable benchmarks that are known to sometimes produce them.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow] pitrou commented on pull request #36932: GH-36931: [C++] Add cumulative_mean function
Posted by "pitrou (via GitHub)" <gi...@apache.org>.
pitrou commented on PR #36932:
URL: https://github.com/apache/arrow/pull/36932#issuecomment-1671381247
+1
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow] js8544 commented on a diff in pull request #36932: GH-36931: [C++] Add cumulative_mean function
Posted by "js8544 (via GitHub)" <gi...@apache.org>.
js8544 commented on code in PR #36932:
URL: https://github.com/apache/arrow/pull/36932#discussion_r1288448987
##########
docs/source/cpp/compute.rst:
##########
@@ -1621,21 +1621,23 @@ do not detect overflow. They are alsoavailable in an overflow-checking variant,
suffixed ``_checked``, which returns an ``Invalid`` :class:`Status` when
overflow is detected.
-+------------------------+-------+-------------+-------------+--------------------------------+-------+
-| Function name | Arity | Input types | Output type | Options class | Notes |
-+=========================+=======+=============+=============+================================+=======+
-| cumulative_sum | Unary | Numeric | Numeric | :struct:`CumulativeOptions` | \(1) |
-+-------------------------+-------+-------------+-------------+--------------------------------+-------+
-| cumulative_sum_checked | Unary | Numeric | Numeric | :struct:`CumulativeOptions` | \(1) |
-+-------------------------+-------+-------------+-------------+--------------------------------+-------+
-| cumulative_prod | Unary | Numeric | Numeric | :struct:`CumulativeOptions` | \(1) |
-+-------------------------+-------+-------------+-------------+--------------------------------+-------+
-| cumulative_prod_checked | Unary | Numeric | Numeric | :struct:`CumulativeOptions` | \(1) |
-+-------------------------+-------+-------------+-------------+--------------------------------+-------+
-| cumulative_max | Unary | Numeric | Numeric | :struct:`CumulativeOptions` | \(1) |
-+-------------------------+-------+-------------+-------------+--------------------------------+-------+
-| cumulative_min | Unary | Numeric | Numeric | :struct:`CumulativeOptions` | \(1) |
-+-------------------------+-------+-------------+-------------+--------------------------------+-------+
++-------------------------+-------+-------------+-------------+--------------------------------+-----------+
+| Function name | Arity | Input types | Output type | Options class | Notes |
++=========================+=======+=============+=============+================================+===========+
+| cumulative_sum | Unary | Numeric | Numeric | :struct:`CumulativeOptions` | \(1) |
++-------------------------+-------+-------------+-------------+--------------------------------+-----------+
+| cumulative_sum_checked | Unary | Numeric | Numeric | :struct:`CumulativeOptions` | \(1) |
++-------------------------+-------+-------------+-------------+--------------------------------+-----------+
+| cumulative_prod | Unary | Numeric | Numeric | :struct:`CumulativeOptions` | \(1) |
++-------------------------+-------+-------------+-------------+--------------------------------+-----------+
+| cumulative_prod_checked | Unary | Numeric | Numeric | :struct:`CumulativeOptions` | \(1) |
++-------------------------+-------+-------------+-------------+--------------------------------+-----------+
+| cumulative_max | Unary | Numeric | Numeric | :struct:`CumulativeOptions` | \(1) |
++-------------------------+-------+-------------+-------------+--------------------------------+-----------+
+| cumulative_min | Unary | Numeric | Numeric | :struct:`CumulativeOptions` | \(1) |
++-------------------------+-------+-------------+-------------+--------------------------------+-----------+
+| cumulative_mean | Unary | Numeric | Double | :struct:`CumulativeOptions` | \(1) \(2) |
Review Comment:
Fixed
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow] js8544 commented on a diff in pull request #36932: GH-36931: [C++] Add cumulative_mean function
Posted by "js8544 (via GitHub)" <gi...@apache.org>.
js8544 commented on code in PR #36932:
URL: https://github.com/apache/arrow/pull/36932#discussion_r1288448362
##########
cpp/src/arrow/compute/kernels/vector_cumulative_ops_test.cc:
##########
@@ -37,19 +37,23 @@
namespace arrow {
namespace compute {
-constexpr static std::array<const char*, 6> kCumulativeFunctionNames{
+constexpr static std::array<const char*, 7> kCumulativeFunctionNames{
Review Comment:
Right, fixed. (Somehow I'm really obsessed with constexpr arrays......)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org