Struct re_viewer::external::re_chunk_store::QueryExpression
source · pub struct QueryExpression {
pub view_contents: Option<BTreeMap<EntityPath, Option<BTreeSet<ComponentName>>>>,
pub include_semantically_empty_columns: bool,
pub include_indicator_columns: bool,
pub include_tombstone_columns: bool,
pub filtered_index: Option<Timeline>,
pub filtered_index_range: Option<ResolvedTimeRange>,
pub filtered_index_values: Option<BTreeSet<TimeInt>>,
pub using_index_values: Option<BTreeSet<TimeInt>>,
pub filtered_is_not_null: Option<ComponentColumnSelector>,
pub sparse_fill_strategy: SparseFillStrategy,
pub selection: Option<Vec<ColumnSelector>>,
}
Expand description
Describes a complete query for Rerun’s dataframe API.
§Terminology: view vs. selection vs. filtering vs. sampling
-
The view contents specify which subset of the database (i.e., which columns) the query runs on, expressed as a set of
EntityPath
s and their associatedComponentName
s. -
The filters filter out rows of data from the view contents. A filter cannot possibly introduce new rows, it can only remove existing ones from the view contents.
-
The samplers sample rows of data from the view contents at user-specified values. Samplers don’t necessarily return existing rows: they might introduce new ones if the sampled value isn’t present in the view contents in the first place.
-
The selection applies last and samples columns of data from the filtered/sampled view contents. Selecting a column that isn’t present in the view contents results in an empty column in the final dataframe (null array).
A very rough mental model, in SQL terms:
SELECT <Self::selection> FROM <Self::view_contents> WHERE <Self::filtered_*>
Fields§
§view_contents: Option<BTreeMap<EntityPath, Option<BTreeSet<ComponentName>>>>
The subset of the database that the query will run on: a set of EntityPath
s and their
associated ComponentName
s.
Defaults to None
, which means: everything.
Example (pseudo-code):
view_contents = {
"world/points": [rr.Position3D, rr.Radius],
"metrics": [rr.Scalar]
}
include_semantically_empty_columns: bool
Whether the view_contents
should ignore semantically empty columns.
A semantically empty column is a column that either contains no data at all, or where all
values are either nulls or empty arrays ([]
).
view_contents
: QueryExpression::view_contents
include_indicator_columns: bool
Whether the view_contents
should ignore columns corresponding to indicator components.
Indicator components are marker components, generally automatically inserted by Rerun, that helps keep track of the original context in which a piece of data was logged/sent.
view_contents
: QueryExpression::view_contents
include_tombstone_columns: bool
Whether the view_contents
should ignore columns corresponding to Clear
-related components.
view_contents
: QueryExpression::view_contents
Clear
: re_types_core::archetypes::Clear
filtered_index: Option<Timeline>
The index used to filter out rows from the view contents.
Only rows where at least 1 column contains non-null data at that index will be kept in the final dataset.
If left unspecified, the results will only contain static data.
Examples: Some(Timeline("frame"))
, None
(only static data).
filtered_index_range: Option<ResolvedTimeRange>
The range of index values used to filter out rows from the view contents.
Only rows where at least 1 of the view-contents contains non-null data within that range will be kept in the final dataset.
- This has no effect if
filtered_index
isn’t set. - This has no effect if
QueryExpression::using_index_values
is set.
Example: ResolvedTimeRange(10, 20)
.
filtered_index_values: Option<BTreeSet<TimeInt>>
The specific index values used to filter out rows from the view contents.
Only rows where at least 1 column contains non-null data at these specific values will be kept in the final dataset.
- This has no effect if
filtered_index
isn’t set. - This has no effect if
QueryExpression::using_index_values
is set. - Using
TimeInt::STATIC
as index value has no effect.
Example: [TimeInt(12), TimeInt(14)]
.
using_index_values: Option<BTreeSet<TimeInt>>
The specific index values used to sample rows from the view contents.
The final dataset will contain one row per sampled index value, regardless of whether data
existed for that index value in the view contents.
The semantics of the query are consistent with all other settings: the results will be
sorted on the filtered_index
, and only contain unique index values.
- This has no effect if
filtered_index
isn’t set. - If set, this overrides both
QueryExpression::filtered_index_range
andQueryExpression::filtered_index_values
. - Using
TimeInt::STATIC
as index value has no effect.
Example: [TimeInt(12), TimeInt(14)]
.
filtered_is_not_null: Option<ComponentColumnSelector>
The component column used to filter out rows from the view contents.
Only rows where this column contains non-null data be kept in the final dataset.
Example: ComponentColumnSelector("rerun.components.Position3D")
.
sparse_fill_strategy: SparseFillStrategy
Specifies how null values should be filled in the returned dataframe.
Defaults to SparseFillStrategy::None
.
selection: Option<Vec<ColumnSelector>>
The specific columns to sample from the final view contents.
The order of the samples will be respected in the final result.
Defaults to None
, which means: everything.
Example: [ColumnSelector(Time("log_time")), ColumnSelector(Component("rerun.components.Position3D"))]
.
Trait Implementations§
source§impl Clone for QueryExpression
impl Clone for QueryExpression
source§fn clone(&self) -> QueryExpression
fn clone(&self) -> QueryExpression
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for QueryExpression
impl Debug for QueryExpression
source§impl Default for QueryExpression
impl Default for QueryExpression
source§fn default() -> QueryExpression
fn default() -> QueryExpression
source§impl Hash for QueryExpression
impl Hash for QueryExpression
source§impl PartialEq for QueryExpression
impl PartialEq for QueryExpression
source§fn eq(&self, other: &QueryExpression) -> bool
fn eq(&self, other: &QueryExpression) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl TryFrom<Query> for QueryExpression
impl TryFrom<Query> for QueryExpression
§type Error = TypeConversionError
type Error = TypeConversionError
source§fn try_from(
value: Query
) -> Result<QueryExpression, <QueryExpression as TryFrom<Query>>::Error>
fn try_from( value: Query ) -> Result<QueryExpression, <QueryExpression as TryFrom<Query>>::Error>
impl Eq for QueryExpression
impl StructuralPartialEq for QueryExpression
Auto Trait Implementations§
impl Freeze for QueryExpression
impl RefUnwindSafe for QueryExpression
impl Send for QueryExpression
impl Sync for QueryExpression
impl Unpin for QueryExpression
impl UnwindSafe for QueryExpression
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CheckedAs for T
impl<T> CheckedAs for T
source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
source§impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request