feat: initial implementation for range cache with time filters (#8130)

* feat: initial implementation for range cache time filters

Signed-off-by: evenyag <realevenyag@gmail.com>

* refactor: tighten Lt implied time range bound

Signed-off-by: evenyag <realevenyag@gmail.com>

* docs: tighten range cache key comment

Signed-off-by: evenyag <realevenyag@gmail.com>

* fix: skip range cache unit asserts on empty implied range

Signed-off-by: evenyag <realevenyag@gmail.com>

---------

Signed-off-by: evenyag <realevenyag@gmail.com>
This commit is contained in:
Yingwen
2026-05-26 15:03:31 +08:00
committed by GitHub
parent c84462bdc1
commit 6193e8760b
4 changed files with 590 additions and 94 deletions

View File

@@ -41,7 +41,7 @@ mod stats;
/// In theory, it should be converted to a timestamp scalar value by `TypeConversionRule`.
macro_rules! return_none_if_utf8 {
($lit: ident) => {
if matches!($lit, ScalarValue::Utf8(_)) {
if is_string_timestamp_literal($lit) {
warn!(
"Unexpected ScalarValue::Utf8 in time range predicate: {:?}. Maybe it's an implicit bug, please report it to https://github.com/GreptimeTeam/greptimedb/issues",
$lit
@@ -53,6 +53,13 @@ macro_rules! return_none_if_utf8 {
};
}
pub fn is_string_timestamp_literal(scalar: &ScalarValue) -> bool {
matches!(
scalar,
ScalarValue::Utf8(_) | ScalarValue::LargeUtf8(_) | ScalarValue::Utf8View(_)
)
}
/// Reference-counted pointer to a list of logical exprs and a list of dynamic filter physical exprs.
#[derive(Debug, Clone, Default)]
pub struct Predicate {