-
Notifications
You must be signed in to change notification settings - Fork 1
feat: ChunkedArray null methods (drop, count) #10
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
base: main
Are you sure you want to change the base?
Conversation
Thanks for the PR! Going to take a look tomorrow. |
43eb47a
to
fb6f5a7
Compare
firebolt/arrays/chunked_array.mojo
Outdated
""" | ||
|
||
var dtype: DataType | ||
var length: Int |
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.
We should store the null_count as well as the length.
var buffer_start = 0 | ||
# Process each buffer. | ||
for buffer_index in range(len(self.buffers)): | ||
var buffer = self.buffers[buffer_index] |
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.
What happens in the case of nested types? In case of List
we have three buffers: validity, offsets, values.
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.
Hm, the individual type will have to know that. Let me see what language features we have available.
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.
Could we implement drop_nulls
on the typed array interfaces ListArray, BinaryArray, PrimitiveArray[T]
?
fn size(self) -> Int: | ||
return self.buffer.size | ||
|
||
fn grow[I: Intable](mut self, target_length: I): | ||
return self.buffer.grow[DType.bool](target_length) | ||
|
||
@always_inline | ||
fn bit_count(self) -> Int: |
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.
Are these methods covered with tests?
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.
Seems like partial_byte_set
doesn't have a corresponding test case.
Looks good on principle but would be nice if we could split this into 3 PRs:
|
fb6f5a7
to
16c1420
Compare
Implement some of the methods for null support: drop and count.