mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-05-23 08:20:36 +00:00
feat: memtable stats (#1591)
* feat: memtable stats * chore: add tests for timestamp subtraction * feat: add `Value:as_timestamp` method
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user