mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-11-20 17:54:12 +00:00
fix(promql): align aggregate admission with boxed parser inputs
Signed-off-by: discord9 <55937128+discord9@users.noreply.github.com>
This commit is contained in:
@@ -44,7 +44,7 @@ use datafusion_expr::Expr;
|
||||
use datatypes::series::SeriesOrdering;
|
||||
use datatypes::series::samples::{FieldSpec, SeriesSchema};
|
||||
use promql::extension_plan::{AggregateFinalize, FusedSeries, FusedSeriesBinding};
|
||||
use promql::native::plan::{NativeExpr, NativeNode, NativeTree, reads_across_series};
|
||||
use promql::native::plan::{NativeExpr, NativeNode, reads_across_series};
|
||||
use promql::vector_match::{Cardinality, MatchingLabels};
|
||||
use promql_parser::label::Matchers;
|
||||
use promql_parser::parser::value::ValueType;
|
||||
@@ -716,11 +716,11 @@ pub(crate) fn pointwise_operand(node: &NativeNode) -> bool {
|
||||
fn admitted_single_selector(expr: &PromExpr) -> bool {
|
||||
fn aggregate(expr: &PromExpr) -> bool {
|
||||
match expr {
|
||||
PromExpr::Aggregate(_) => true,
|
||||
PromExpr::Aggregate(_aggregate) => true,
|
||||
PromExpr::Paren(paren) => aggregate(&paren.expr),
|
||||
PromExpr::Unary(unary) => aggregate(&unary.expr),
|
||||
PromExpr::Binary(binary) => aggregate(&binary.lhs) || aggregate(&binary.rhs),
|
||||
PromExpr::Call(call) => call.args.args.iter().any(aggregate),
|
||||
PromExpr::Call(call) => call.args.args.iter().any(|arg| aggregate(arg)),
|
||||
_ => false,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,7 +39,6 @@ use datafusion::datasource::source::DataSourceExec;
|
||||
use datafusion::datasource::{MemTable, provider_as_source};
|
||||
use datafusion::execution::context::SessionContext;
|
||||
use datafusion::logical_expr::{Extension, UserDefinedLogicalNodeCore, col};
|
||||
use datafusion_expr::UserDefinedLogicalNode;
|
||||
use datatypes::prelude::ConcreteDataType;
|
||||
use datatypes::schema::{ColumnSchema, Schema};
|
||||
use datatypes::series::SeriesOrdering;
|
||||
@@ -2502,7 +2501,7 @@ fn find_aggregate_finalize(plan: &LogicalPlan) -> Option<&AggregateFinalize> {
|
||||
/// The producer below a split aggregate, which exports the state one partition folded.
|
||||
fn partial_producer(finalize: &AggregateFinalize) -> &FusedSeries {
|
||||
// Bound to a local first: the slice handed out by `inputs` borrows this list.
|
||||
let inputs = UserDefinedLogicalNode::inputs(finalize);
|
||||
let inputs = UserDefinedLogicalNodeCore::inputs(finalize);
|
||||
let [LogicalPlan::Extension(Extension { node })] = inputs.as_slice() else {
|
||||
panic!("the merge should read one producer: {finalize:?}");
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user