MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / schema_conversion

Function schema_conversion

nodedb/src/engine/timeseries/columnar_bridge.rs:284–301  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

282
283 #[test]
284 fn schema_conversion() {
285 let ts_schema = super::super::columnar_memtable::ColumnarSchema {
286 columns: vec![
287 ("timestamp".into(), TsColumnType::Timestamp),
288 ("value".into(), TsColumnType::Float64),
289 ("host".into(), TsColumnType::Symbol),
290 ],
291 timestamp_idx: 0,
292 codecs: vec![nodedb_codec::ColumnCodec::Auto; 3],
293 };
294
295 let shared = ts_schema_to_shared(&ts_schema);
296 assert_eq!(shared.columns.len(), 3);
297 assert_eq!(shared.columns[0].column_type, SharedColumnType::Timestamp);
298 assert_eq!(shared.columns[1].column_type, SharedColumnType::Float64);
299 // Symbol → Int64 in shared format.
300 assert_eq!(shared.columns[2].column_type, SharedColumnType::Int64);
301 }
302
303 #[test]
304 fn drain_to_shared_segment_roundtrip() {

Callers

nothing calls this directly

Calls 1

ts_schema_to_sharedFunction · 0.85

Tested by

no test coverage detected