You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "zeroshade (via GitHub)" <gi...@apache.org> on 2023/01/26 20:34:53 UTC
[GitHub] [arrow] zeroshade commented on a diff in pull request #14146: ARROW-17750: [Go] Kernel Input Type for RLE
zeroshade commented on code in PR #14146:
URL: https://github.com/apache/arrow/pull/14146#discussion_r1088313676
##########
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:
good point, it should. i'll fix that
--
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