Skip to content

Commit

Permalink
Updates from PR
Browse files Browse the repository at this point in the history
  • Loading branch information
jleibs committed Sep 19, 2024
1 parent 2437b61 commit e050419
Showing 1 changed file with 29 additions and 1 deletion.
30 changes: 29 additions & 1 deletion crates/store/re_chunk_store/src/dataframe.rs
Original file line number Diff line number Diff line change
Expand Up @@ -411,6 +411,7 @@ pub enum ColumnSelector {
}

impl From<ColumnDescriptor> for ColumnSelector {
#[inline]
fn from(desc: ColumnDescriptor) -> Self {
match desc {
ColumnDescriptor::Control(desc) => Self::Control(desc.into()),
Expand All @@ -421,18 +422,21 @@ impl From<ColumnDescriptor> for ColumnSelector {
}

impl From<ControlColumnSelector> for ColumnSelector {
#[inline]
fn from(desc: ControlColumnSelector) -> Self {
Self::Control(desc)
}
}

impl From<TimeColumnSelector> for ColumnSelector {
#[inline]
fn from(desc: TimeColumnSelector) -> Self {
Self::Time(desc)
}
}

impl From<ComponentColumnSelector> for ColumnSelector {
#[inline]
fn from(desc: ComponentColumnSelector) -> Self {
Self::Component(desc)
}
Expand All @@ -447,7 +451,17 @@ pub struct ControlColumnSelector {
pub component: ComponentName,
}

impl ControlColumnSelector {
#[inline]
pub fn row_id() -> Self {
Self {
component: RowId::name(),
}
}
}

impl From<ControlColumnDescriptor> for ControlColumnSelector {
#[inline]
fn from(desc: ControlColumnDescriptor) -> Self {
Self {
component: desc.component_name,
Expand All @@ -463,9 +477,10 @@ pub struct TimeColumnSelector {
}

impl From<TimeColumnDescriptor> for TimeColumnSelector {
#[inline]
fn from(desc: TimeColumnDescriptor) -> Self {
Self {
timeline: desc.timeline.name().clone(),
timeline: *desc.timeline.name(),
}
}
}
Expand All @@ -489,6 +504,7 @@ pub struct ComponentColumnSelector {
}

impl From<ComponentColumnDescriptor> for ComponentColumnSelector {
#[inline]
fn from(desc: ComponentColumnDescriptor) -> Self {
Self {
entity_path: desc.entity_path.clone(),
Expand All @@ -499,6 +515,8 @@ impl From<ComponentColumnDescriptor> for ComponentColumnSelector {
}

impl ComponentColumnSelector {
/// Select a component of a given type, based on its [`EntityPath`]
#[inline]
pub fn new<C: re_types_core::Component>(entity_path: EntityPath) -> Self {
Self {
entity_path,
Expand All @@ -507,6 +525,16 @@ impl ComponentColumnSelector {
}
}

/// Select a component based on its [`EntityPath`] and [`ComponentName`].
#[inline]
pub fn new_for_component_name(entity_path: EntityPath, component: ComponentName) -> Self {
Self {
entity_path,
component,
join_encoding: JoinEncoding::default(),
}
}

/// Specify how the data should be joined into the `RecordBatch`.
#[inline]
pub fn with_join_encoding(mut self, join_encoding: JoinEncoding) -> Self {
Expand Down

0 comments on commit e050419

Please sign in to comment.