-
Notifications
You must be signed in to change notification settings - Fork 727
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dyn compare for binary array #1238
dyn compare for binary array #1238
Conversation
Signed-off-by: remzi <13716567376yh@gmail.com>
Signed-off-by: remzi <13716567376yh@gmail.com>
Signed-off-by: remzi <13716567376yh@gmail.com>
… to build binary dictionary array Signed-off-by: remzi <13716567376yh@gmail.com>
Signed-off-by: remzi <13716567376yh@gmail.com>
Codecov Report
@@ Coverage Diff @@
## master #1238 +/- ##
==========================================
+ Coverage 82.70% 82.95% +0.24%
==========================================
Files 175 178 +3
Lines 51712 51516 -196
==========================================
- Hits 42770 42736 -34
+ Misses 8942 8780 -162
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me 👍
Left some minor testing suggestions
@@ -3843,6 +3960,114 @@ mod tests { | |||
assert_eq!(neq_dyn_scalar(&array, 8).unwrap(), expected); | |||
} | |||
|
|||
#[test] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps we could get a test with nulls?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, I will add them
let large_array = LargeBinaryArray::from_vec( | ||
vec![b"arrow", b"datafusion", b"flight", b"parquet", &[0xff, 0xf8]], | ||
); | ||
let scalar = "flight".as_bytes(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps one of these tests could use a non-UTF8 string as the scalar.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this code looks good -- thank you for the contribution @HaoYang670
I agree with @tustvold on the benefits of tests with Null
and non utf-8, though that could be done in a follow on if you prefer.
Signed-off-by: remzi <13716567376yh@gmail.com>
Signed-off-by: remzi <13716567376yh@gmail.com>
Signed-off-by: remzi <13716567376yh@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks again @HaoYang670
Which issue does this PR close?
Closes #1108
Rationale for this change
What changes are included in this PR?
typed_compare
, so that it supports compare 2 binary arrays*_dyn_binary_scalar
.DictionaryArray
with binary values is not supported so far, because I could not find an easy way to build a binary dictionary array. Is there any builder such asStringDictionaryBuilder
can be used for binary type?Are there any user-facing changes?