Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
members = [
"crates/asap-physical-operators",
"crates/types",
"crates/frontend-common",
"crates/sql-function-catalog",
"crates/asap-aware-mapping",
"crates/frontend-promql",
Expand Down
11 changes: 11 additions & 0 deletions crates/frontend-common/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[package]
name = "asap-frontend-common"
version = "0.1.0"
edition = "2021"

# Shared front-end layer: the name-based `UnresolvedOp` tree every front end
# emits, and the resolver that binds it into the unified `OperatorNode` IR.
[dependencies]
asap-types = { path = "../types" }
serde = { version = "1", features = ["derive", "rc"] }
thiserror = "2"
23 changes: 23 additions & 0 deletions crates/frontend-common/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
//! `asap-frontend-common` — the front-end-facing, name-based operator tree
//! and its resolver into the unified IR.
//!
//! A front end builds an [`UnresolvedOp`] tree (column references are
//! name-based [`ColumnRef`](asap_types::pre_asap::ColumnRef)s) during its
//! own `interpret` step and calls [`resolve_root`], which binds every
//! reference to a positional `ColumnId` and returns the
//! [`OperatorNode`](asap_types::ir::OperatorNode) DAG.
//!
//! - [`unresolved`] — [`UnresolvedOp`] / [`UnresolvedScalar`]: the tree.
//! - [`schema_resolver`] — [`SchemaResolver`]: builds the binding schema of a
//! schemaless (PromQL) leaf from the names the query references.
//! - [`resolve`] — [`resolve_root`]: the bottom-up binding walk.

pub mod resolve;
pub mod schema_resolver;
pub mod unresolved;

pub use resolve::{resolve_expr, resolve_root, resolve_scalar_root, ResolveDAGError};
pub use schema_resolver::{SchemaCatalog, SchemaResolver, UsageDerivedCatalog};
pub use unresolved::{
UnresolvedOp, UnresolvedPredicate, UnresolvedProjectItem, UnresolvedScalar, UnresolvedSortKey,
};
Loading