Databend is a Rust workspace rooted at Cargo.toml. Start by deciding whether the change belongs to the query engine or the metadata system, then read the closest module README before editing.
src/query/is the main query engine: SQL parsing, planning, optimization, expression evaluation, execution pipeline, query service integration, and table/storage-facing behavior all converge here. If the task changes SQL behavior, planner output, execution, storage access, or query-side tests, start withsrc/query/README.md.src/meta/is the metadata side of the system: metadata types, protocol definitions, compatibility layers, supporting tooling, and the Databend meta-service binaries live here. If the task touches catalog/schema metadata, protobuf compatibility, meta APIs, ordatabend-metatooling, start withsrc/meta/README.md.src/meta/README.mdalso notes an important boundary: core meta-service implementation has moved to the separatedatabend-metarepository. Read it early if you suspect the code you need is no longer in this workspace.
- Use
src/query/README.mdas the index for query-side crates. It explains the role of modules such asast,catalog,expression,functions,pipeline,service,storages, and related support crates. - Prefer the nearest module README when one exists instead of inferring structure from directory names alone.
- Read
src/query/ast/README.mdwhen the task is about SQL parser structure, grammar internals, or parser-specific development workflow. - Read
src/query/functions/README.mdwhen adding or debugging scalar or aggregate functions, function registration, or function-specific tests. - Read
src/query/ee_features/README.mdwhen the task involves enterprise query features and you need to confirm which feature layer owns the behavior. - Read
src/query/sql/README.mdwhen the task lives in SQL planning, binding, optimizer behavior, or SQL-side planner tests.
- Shared crates live in
src/common/. - Binaries are stored under
src/binaries/. - Tests live in
tests/, including SQL suites undertests/suites/, sqllogic cases, and meta-specific harnesses. - Performance experiments live in
benchmark/. - Tooling and deployment helpers live in
scripts/anddocker/. - Fixtures live in
_data/. - The
Makefilelists supported top-level tasks.