Documentation
¶
Overview ¶
Package starrocks provides direct lineage analysis for StarRocks queries.
This implementation is built on github.com/bytebase/omni's StarRocks parser and typed AST, mirroring backend/plugin/lineage/mysql. It is a port rather than a dialect copy: omni's StarRocks AST differs structurally from its MySQL AST (set operations are a separate node, the select list is []*SelectItem, and derived tables, CTAS and expression subqueries keep their query as raw text).
Engine registration is scoped to STARROCKS. DORIS has an analyzer of its own in backend/plugin/lineage/doris: omni ships a Doris parser too, and the two grammars differ where it matters (parenthesized queries, table functions, LATERAL VIEW), so neither engine is read with the other's grammar.
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 StarRocks 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.
Doris is not served here: it has its own analyzer package, because omni's Doris grammar differs from this one.
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 StarRocks statement.
func NewAnalyzer ¶
NewAnalyzer creates a StarRocks 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.