Skip to content

[Design] Why the SummaryExpr is designed like this? #463

Description

@Selvomega

See the following code

fn summary_children(expr: &SummaryExpr) -> Vec<&Rc<SummaryNode>> {
    match expr {
        SummaryExpr::KeepPreAsap(_) => vec![],
        SummaryExpr::BinaryOp { lhs, rhs, .. } => vec![lhs, rhs],
        SummaryExpr::CandidateTopK { candidates, values, .. } => vec![candidates, values],
        SummaryExpr::ValueOperation { child, .. } => vec![child],
        SummaryExpr::RelationalJoin { left, right, .. } => vec![left, right],
        SummaryExpr::SummaryAgg { child, .. } => vec![child],
        SummaryExpr::SummaryJoin { outer, inner, .. } => vec![outer, inner],
        SummaryExpr::SummarySubtract { left, right } => vec![left, right],
        SummaryExpr::SummaryDelete { summary_input, .. } => vec![summary_input],
        SummaryExpr::SummaryEstimate { summary_input, .. } => vec![summary_input],
        SummaryExpr::SummaryMerge { children } => children.iter().collect(),
    }
}

I don't know what is the design principle of these branches. For example, I cannot understand

  1. Why ValueOperation is a parallel concept with BinaryOp: BinaryOp looks like a special case of projection, which is a sub-concept of ValueOperation.
  2. Why KeepPreASAP is a parallel concept with ValueOperation: They both contain lots of repeated concepts, like projection, filter, so on and so forth
  3. What is the relation between ExactAggregate in SummaryAgg and the original aggregation in KeepPreAsap?

I feel there are a lot of semantic overlaps in the post-ASAP-DAG language and am really lost.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions