-
Notifications
You must be signed in to change notification settings - Fork 395
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
Port row_ids to arrow1 #8657
Port row_ids to arrow1 #8657
Conversation
Web viewer built successfully. If applicable, you should also test it:
Note: This comment is updated whenever you push a commit. |
61e99f2
to
910269c
Compare
@rerun-bot full-check |
Started a full build: https://github.com/rerun-io/rerun/actions/runs/12726236739 |
@@ -943,7 +934,11 @@ impl Chunk { | |||
entity_path, | |||
heap_size_bytes: Default::default(), | |||
is_sorted: true, | |||
row_ids: Arrow2StructArray::new_empty(RowId::arrow2_datatype()), | |||
row_ids: arrow::array::StructBuilder::from_fields( |
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.
Here and elsewhere, it feels odd to me that we're going through a builder type just to build an empty thing.
Any particular reason we're not calling https://docs.rs/arrow/latest/arrow/array/fn.new_empty_array.html ?
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.
new_empty_array
returns an ArrayRef
, meaning we would need .as_any().downcast_ref::<StructArray>().unwrap().clone()
here.
StructBuilder
returns what we want.
@@ -11,13 +11,18 @@ use crate::{DeserializationError, Loggable}; | |||
|
|||
// --- | |||
|
|||
// TODO(emilk): This is a bit ugly… but good enough for now? | |||
pub fn tuid_arrow_fields() -> Fields { |
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.
Can't you get rid of this if you get rid of using the builder type for an empty array?
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.
Yes, but at the cost of some ugly dynamic casting and unwraps that I'd rather avoid
#[inline] | ||
fn heap_size_bytes(&self) -> u64 { | ||
self.get_array_memory_size() as u64 | ||
} | ||
} | ||
|
||
impl<T: ArrowPrimitiveType> SizeBytes for PrimitiveArray<T> { | ||
impl<T: Array> SizeBytes for &T { |
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.
Method already takes &self
:
impl<T: Array> SizeBytes for &T { | |
impl<T: Array> SizeBytes for T { |
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.
Related
re_arrow2
toarrow
#3741