starrocks

package
v0.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 18, 2026 License: Apache-2.0 Imports: 12 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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 Analyze

func Analyze(ctx context.Context, sql string, cat catalog.Provide) ([]model.ColumnRelation, error)

Analyze parses a single StarRocks statement and returns its column relations.

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

func SplitStatements(sql string) []string

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

func NewAnalyzer(ctx context.Context, sql string, catalogProvide catalog.Provide) *Analyzer

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL