Add Series RTL and SeriesView
Introduces a new RTL module for handling series data, enabling efficient storage and retrieval of time-series data in a Struct-of-Arrays (SoA) format. Includes `SeriesView`, a zero-copy wrapper that provides a fast, read-only interface to individual columns within a `RecordSeries`, optimizing performance for data access in the VM. Registers new native functions `create-series` and `push-series` for managing series data.
This commit is contained in:
@@ -284,6 +284,7 @@ pub enum StaticType {
|
||||
Text,
|
||||
Keyword,
|
||||
List(Box<StaticType>), // Legacy / Dynamic list
|
||||
Series(Box<StaticType>), // Time series of a specific type
|
||||
Tuple(Vec<StaticType>), // Heterogeneous fixed-size
|
||||
Vector(Box<StaticType>, usize), // Homogeneous fixed-size
|
||||
Matrix(Box<StaticType>, Vec<usize>), // Multi-dimensional homogeneous
|
||||
@@ -306,6 +307,7 @@ impl fmt::Display for StaticType {
|
||||
StaticType::Text => write!(f, "text"),
|
||||
StaticType::Keyword => write!(f, "keyword"),
|
||||
StaticType::List(inner) => write!(f, "[{}]", inner),
|
||||
StaticType::Series(inner) => write!(f, "series<{}>", inner),
|
||||
StaticType::Tuple(elements) => {
|
||||
write!(f, "[")?;
|
||||
for (i, el) in elements.iter().enumerate() {
|
||||
@@ -391,6 +393,10 @@ impl StaticType {
|
||||
(StaticType::Record(a), StaticType::Record(b)) => {
|
||||
std::sync::Arc::ptr_eq(a, b)
|
||||
}
|
||||
// Series are assignable if their inner types are assignable
|
||||
(StaticType::Series(inner_a), StaticType::Series(inner_b)) => {
|
||||
inner_a.is_assignable_from(inner_b)
|
||||
}
|
||||
_ => false,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user