mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-08-18 03:58:29 +00:00
feat: update promql-parser to commit fec3c8b (#881)
deps: update promql-parser to commit fec3c8b Signed-off-by: Ruihang Xia <waynestxia@gmail.com> Signed-off-by: Ruihang Xia <waynestxia@gmail.com>
This commit is contained in:
@@ -27,7 +27,7 @@ futures-util.workspace = true
|
||||
metrics = "0.20"
|
||||
once_cell = "1.10"
|
||||
promql = { path = "../promql" }
|
||||
promql-parser = { git = "https://github.com/GreptimeTeam/promql-parser.git", rev = "d2f6ec4bbbae19b5156cfc977a6e7de9c6684651" }
|
||||
promql-parser = { git = "https://github.com/GreptimeTeam/promql-parser.git", rev = "fec3c8bcee982b8add2a77d07818d3cbe92b89fe" }
|
||||
serde.workspace = true
|
||||
serde_json = "1.0"
|
||||
session = { path = "../session" }
|
||||
|
||||
+22
-20
@@ -56,33 +56,35 @@ impl QueryLanguageParser {
|
||||
pub fn parse_promql(_promql: &str) -> Result<QueryStatement> {
|
||||
let _timer = timer!(METRIC_PARSE_PROMQL_ELAPSED);
|
||||
|
||||
let prom_expr = PromExpr::Call {
|
||||
let prom_expr = PromExpr::Call(promql_parser::parser::Call {
|
||||
func: Function {
|
||||
name: "ceil",
|
||||
arg_types: vec![ValueType::Vector],
|
||||
variadic: false,
|
||||
return_type: ValueType::Vector,
|
||||
},
|
||||
args: vec![Box::new(PromExpr::VectorSelector {
|
||||
name: Some("demo".to_owned()),
|
||||
offset: None,
|
||||
start_or_end: None,
|
||||
label_matchers: Matchers {
|
||||
matchers: vec![
|
||||
Matcher {
|
||||
op: MatchOp::Equal,
|
||||
name: "host".to_string(),
|
||||
value: "host1".to_string(),
|
||||
},
|
||||
Matcher {
|
||||
op: MatchOp::Equal,
|
||||
name: promql_parser::label::METRIC_NAME.to_string(),
|
||||
value: "demo".to_string(),
|
||||
},
|
||||
],
|
||||
args: vec![Box::new(PromExpr::VectorSelector(
|
||||
promql_parser::parser::VectorSelector {
|
||||
name: Some("demo".to_owned()),
|
||||
offset: None,
|
||||
start_or_end: None,
|
||||
label_matchers: Matchers {
|
||||
matchers: vec![
|
||||
Matcher {
|
||||
op: MatchOp::Equal,
|
||||
name: "host".to_string(),
|
||||
value: "host1".to_string(),
|
||||
},
|
||||
Matcher {
|
||||
op: MatchOp::Equal,
|
||||
name: promql_parser::label::METRIC_NAME.to_string(),
|
||||
value: "demo".to_string(),
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
})],
|
||||
};
|
||||
))],
|
||||
});
|
||||
let eval_stmt = EvalStmt {
|
||||
expr: prom_expr,
|
||||
start: std::time::UNIX_EPOCH,
|
||||
|
||||
Reference in New Issue
Block a user