public final class LineageAnalyzer extends Object
The document carries the statement inventory — 1-based
statementIndex in source order, contract kind,
FINGERPRINT-V1 queryFingerprint, absolute sourceLocation
(1-based, half-open, trailing statement separator excluded) — plus
statement-level degrade [D-09]: a statement that fails to parse yields a
PARSE_FAILED diagnostic on its own entry and the remaining
statements are unaffected; the engine never throws for malformed SQL.
Edge extraction is per statement kind: SELECT statements flow
through StatementLineageExtractor (US-021); the remaining kinds
land with their stories (US-022+), so transformGraphs is still
empty.
The artifactLocator is bound here, at the API boundary where
the unit is known: from LineageConfig.getArtifactLocator() for
text input, or the file's base name for the File overload (the
config value wins when non-empty).
The Catalog parameter feeds the semantic gate and the
endpoint resolutionStatus computation; the full BindingGate
(AMBIGUOUS / PARSER_UNSUPPORTED facts) arrives with US-025.
This class is stateless and its static methods are safe to call from multiple threads.
Internal API: not part of the public gsqlparser surface.
| Modifier and Type | Method and Description |
|---|---|
static LineageResult |
analyze(File unitFile,
EDbVendor vendor,
Catalog catalog,
LineageConfig config)
Analyze a unit supplied as a file (read as UTF-8).
|
static LineageResult |
analyze(String unitText,
EDbVendor vendor,
Catalog catalog,
LineageConfig config)
Analyze a unit supplied as text.
|
public static LineageResult analyze(String unitText, EDbVendor vendor, Catalog catalog, LineageConfig config)
unitText - non-null SQL text of the whole unitvendor - non-null vendor enumcatalog - optional catalog snapshot; may be nullconfig - optional configuration; null means
LineageConfig.defaults()LineageResult;
never throws for malformed SQL (runtime exceptions signal
engine bugs, per contract §2)public static LineageResult analyze(File unitFile, EDbVendor vendor, Catalog catalog, LineageConfig config) throws IOException
artifactLocator defaults to the file's base name; a non-empty
LineageConfig.getArtifactLocator() overrides it.IOException - when the file cannot be read — I/O failures are
the caller's concern, unlike SQL-level failures
which degrade into diagnostics