pitrou commented on code in PR #47297:
URL: https://github.com/apache/arrow/pull/47297#discussion_r2285143249


##########
cpp/src/arrow/compute/kernel.h:
##########
@@ -348,7 +348,24 @@ class ARROW_EXPORT OutputType {
   Resolver resolver_ = NULLPTR;
 };
 
-/// \brief Holds the input types and output type of the kernel.
+/// \brief Additional constraints to apply to the input types of a kernel when 
matching a
+/// specific kernel signature.
+class ARROW_EXPORT MatchConstraint {
+ public:
+  virtual ~MatchConstraint() = default;
+
+  /// \brief Return true if the input types satisfy the constraint.
+  virtual bool Matches(const std::vector<TypeHolder>& types) const = 0;
+};
+
+/// \brief Constraint that all input types are decimal types and have the same 
scale.
+ARROW_EXPORT std::shared_ptr<MatchConstraint> DecimalsHaveSameScale();
+
+/// \brief Constraint that all binary input types are decimal types and the 
first type's
+/// scale >= the second type's.
+ARROW_EXPORT std::shared_ptr<MatchConstraint> BinaryDecimalScaleComparisonGE();

Review Comment:
   > Is `BinaryDecimalScale1GeScale2` better?
   
   Yes :) Not pretty, but more explicit anyway.



-- 
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]

Reply via email to