Compute a simple schema hash for the footer.
(schema: &ColumnarSchema)
| 50 | |
| 51 | /// Compute a simple schema hash for the footer. |
| 52 | pub(super) fn compute_schema_hash(schema: &ColumnarSchema) -> u64 { |
| 53 | use std::hash::{Hash, Hasher}; |
| 54 | // no-determinism: segment compaction footer hash, not Calvin write path; tracked for switch to xxhash with fixed seed |
| 55 | let mut hasher = std::collections::hash_map::DefaultHasher::new(); |
| 56 | for col in &schema.columns { |
| 57 | col.name.hash(&mut hasher); |
| 58 | format!("{:?}", col.column_type).hash(&mut hasher); |
| 59 | } |
| 60 | hasher.finish() |
| 61 | } |
no test coverage detected