mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-05-14 20:10:37 +00:00
chore: add u64 for EqualValue and set expr is true when filter is empty (#6731)
* chore: add u64 for EqualValue and set expr is true when filter is empty * Update src/log-query/src/log_query.rs Co-authored-by: Yingwen <realevenyag@gmail.com> * chore: update EqualValue Uinit to UInt --------- Co-authored-by: Yingwen <realevenyag@gmail.com>
This commit is contained in:
@@ -336,6 +336,8 @@ pub enum EqualValue {
|
||||
Boolean(bool),
|
||||
/// Exact match with a number value.
|
||||
Int(i64),
|
||||
/// Exact match with an unsigned integer value.
|
||||
UInt(u64),
|
||||
/// Exact match with a float value.
|
||||
Float(f64),
|
||||
}
|
||||
@@ -364,6 +366,12 @@ impl From<f64> for EqualValue {
|
||||
}
|
||||
}
|
||||
|
||||
impl From<u64> for EqualValue {
|
||||
fn from(value: u64) -> Self {
|
||||
EqualValue::UInt(value)
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Serialize, Deserialize)]
|
||||
pub enum ContentFilter {
|
||||
// Search-based filters
|
||||
|
||||
@@ -201,7 +201,7 @@ impl LogQueryPlanner {
|
||||
.try_collect::<Vec<_>>()?;
|
||||
|
||||
if filter_exprs.is_empty() {
|
||||
return Ok(None);
|
||||
return Ok(Some(col_expr.is_true()));
|
||||
}
|
||||
|
||||
// Combine all filters with AND logic
|
||||
@@ -475,6 +475,7 @@ impl LogQueryPlanner {
|
||||
EqualValue::Float(n) => lit(ScalarValue::Float64(Some(n))),
|
||||
EqualValue::Int(n) => lit(ScalarValue::Int64(Some(n))),
|
||||
EqualValue::Boolean(b) => lit(ScalarValue::Boolean(Some(b))),
|
||||
EqualValue::UInt(n) => lit(ScalarValue::UInt64(Some(n))),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user