ZhangHuiGui commented on code in PR #41363:
URL: https://github.com/apache/arrow/pull/41363#discussion_r1614383192
##########
cpp/src/arrow/compute/kernels/scalar_if_else.cc:
##########
@@ -1195,6 +1195,43 @@ struct ResolveIfElseExec<NullType, AllocateMem> {
}
};
+template <typename ResolverForOtherTypes>
+Result<TypeHolder> ResolveDecimalCaseType(KernelContext* ctx,
+ const std::vector<TypeHolder>& types,
+ ResolverForOtherTypes&& resolver) {
+ if (!HasDecimal(types)) {
+ return resolver(ctx, types);
+ }
+
+ int32_t max_precision = 0, max_scale = 0;
+ for (auto& type : types) {
+ if (is_floating(type.id()) || is_integer(type.id())) {
+ return Status::Invalid("Need to cast numeric types containing decimal
types");
Review Comment:
Yes, the approach with `TypeMatcher` is more suitable. If there is no
problem with the PR https://github.com/apache/arrow/pull/41012 that contains a
new matcher interface for combination-types, current PR will continue to be
promoted.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]