feat: memtable stats (#1591)

* feat: memtable stats

* chore: add tests for timestamp subtraction

* feat: add `Value:as_timestamp` method
This commit is contained in:
Lei, HUANG
2023-05-17 11:07:07 +08:00
committed by GitHub
parent ca75a7b744
commit e70d49b9cf
12 changed files with 177 additions and 39 deletions

View File

@@ -250,6 +250,15 @@ impl Value {
Ok(scalar_value)
}
/// Casts Value to [Timestamp]. Returns None if it's not a valid timestamp value.
pub fn as_timestamp(&self) -> Option<Timestamp> {
match self {
Value::Int64(v) => Some(Timestamp::new_millisecond(*v)),
Value::Timestamp(t) => Some(*t),
_ => None,
}
}
}
fn to_null_value(output_type: &ConcreteDataType) -> ScalarValue {