lidavidm commented on code in PR #14146:
URL: https://github.com/apache/arrow/pull/14146#discussion_r1088270960
##########
go/arrow/compute/internal/exec/kernel.go:
##########
@@ -242,6 +242,40 @@ func (primitiveMatcher) Equals(other TypeMatcher) bool {
// returns true for.
func Primitive() TypeMatcher { return primitiveMatcher{} }
+type reeMatcher struct {
+ runEndsMatcher TypeMatcher
+ encodedMatcher TypeMatcher
+}
+
+func (r reeMatcher) Matches(typ arrow.DataType) bool {
+ if typ.ID() != arrow.RUN_END_ENCODED {
+ return false
+ }
+
+ dt := typ.(*arrow.RunEndEncodedType)
+ return r.runEndsMatcher.Matches(dt.RunEnds()) &&
r.encodedMatcher.Matches(dt.Encoded())
+}
+
+func (r reeMatcher) Equals(other TypeMatcher) bool {
+ o, ok := other.(reeMatcher)
+ if !ok {
+ return false
+ }
+ return r.runEndsMatcher.Equals(o.runEndsMatcher) &&
r.encodedMatcher.Equals(o.encodedMatcher)
+}
+
+func (r reeMatcher) String() string {
+ return "run_length_encoded(" + r.encodedMatcher.String() + ")"
Review Comment:
should runEndsMatcher be included in the repr?
--
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]