doris

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 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 Analyze

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

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

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

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 Doris statement.

func NewAnalyzer

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

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.

Jump to

Keyboard shortcuts

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