Documentation
¶
Overview ¶
Package doris provides direct lineage analysis for Apache Doris queries.
This implementation is built on github.com/bytebase/omni's Doris parser and typed AST. It is a port of backend/plugin/lineage/starrocks rather than a dialect copy: omni's Doris AST is a sibling of its StarRocks AST, and most of the traversal is identical, but the two grammars differ where it matters to this analyzer —
- a parenthesized query is GroupedQuery{Query}, not ParenSelect{Sel};
- a table-valued function is TableRef.Func, not TableFunctionRef;
- LATERAL VIEW exists and feeds the columns it declares from its generator arguments (processLateralViews);
- INSERT ... BY NAME, a WITH clause before UPDATE/DELETE and the CTASColumns field do not exist.
A statement kind the analyzer cannot model yet (MERGE) is reported as a gap beside the edges the other statements produced, so a coverage gap never discards real lineage.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Registration ¶
func Registration() lineage.EngineRegistration
Registration binds Doris to the analyzer this package provides. The process assembles the registered engines where it is built, so this package does not register itself into package state.
func SplitStatements ¶
SplitStatements splits a script into its individual statements, dropping the ones that carry no SQL. The caller feeds them to Analyze one at a time: this analyzer is defined for exactly one statement.
Types ¶
type Analyzer ¶
type Analyzer struct {
// contains filtered or unexported fields
}
Analyzer performs direct lineage analysis on one Doris statement.
func NewAnalyzer ¶
NewAnalyzer creates a Doris lineage analyzer for a single statement.
func (*Analyzer) AnalyzeRelations ¶
func (a *Analyzer) AnalyzeRelations() ([]model.ColumnRelation, error)
AnalyzeRelations parses the SQL and returns its column relations.
Parsing is strict: a statement omni cannot parse is an error, never a partial result. Multi-statement input is rejected because the analyzer is defined for exactly one statement; the caller splits a script and analyzes it statement by statement.