Zero-copy row ingest for timeseries and high-throughput paths. Accepts borrowed values via `IngestValue<'_>`, avoiding string cloning for tag columns that are already interned in the `DictEncoded` dictionary.
(&mut self, values: &[IngestValue<'_>])
| 179 | /// Accepts borrowed values via `IngestValue<'_>`, avoiding string cloning |
| 180 | /// for tag columns that are already interned in the `DictEncoded` dictionary. |
| 181 | pub fn ingest_row_refs(&mut self, values: &[IngestValue<'_>]) -> Result<(), ColumnarError> { |
| 182 | if values.len() != self.schema.columns.len() { |
| 183 | return Err(ColumnarError::SchemaMismatch { |
| 184 | expected: self.schema.columns.len(), |
| 185 | got: values.len(), |
| 186 | }); |
| 187 | } |
| 188 | |
| 189 | for (i, (col_def, value)) in self.schema.columns.iter().zip(values.iter()).enumerate() { |
| 190 | if matches!(value, IngestValue::Null) && !col_def.nullable { |
| 191 | return Err(ColumnarError::NullViolation(col_def.name.clone())); |
| 192 | } |
| 193 | self.columns[i].push_ref(value, &col_def.name)?; |
| 194 | } |
| 195 | |
| 196 | self.row_count += 1; |
| 197 | Ok(()) |
| 198 | } |
| 199 | |
| 200 | /// Add a new column to the schema, backfilling existing rows with nulls/defaults. |
| 201 | pub fn add_column(&mut self, name: String, column_type: ColumnType, nullable: bool) { |