public class TPowerQueryAnalyzer extends Object
Given a parsed TPowerQueryDocumentStmt, walks the step
graph and produces upstream lineage references. Two patterns are
handled:
Value.NativeQuery() steps — decoded SQL is delegated to
the inner vendor's TGSqlParser instance and the resulting
lineage is surfaced via
PowerQueryLineageResult.getNativeQueryReferences().source{[Name,Kind]}[Data] — segments are
resolved against the connector's expected hierarchy
(ConnectorCatalog.expectedHierarchy(EDbVendor)) and a
synthetic db.schema.table reference is emitted.The analyzer is intentionally independent of the full
DataFlowAnalyzer pipeline — it can be run standalone from
sidecar code or from inside a higher-level lineage aggregator.
Emit policy for navigation refs: every navigation-chain step
produces a PowerQueryLineageResult.NavigationRef, even when the
chain is only consumed as the context argument to a sibling
Value.NativeQuery (in which case the true upstream tables are
inside the decoded SQL, and the context-only nav refs are redundant).
The analyzer stays dumb on purpose — callers that care to distinguish
"real" upstreams from context-only narrowing should deduplicate using
the sibling PowerQueryLineageResult.getNativeQueryReferences().
| Constructor and Description |
|---|
TPowerQueryAnalyzer(TPowerQueryDocumentStmt stmt) |
| Modifier and Type | Method and Description |
|---|---|
PowerQueryLineageResult |
analyze() |
TPowerQueryAnalyzer |
withExplicitInnerVendor(EDbVendor vendor)
Force the SQL dialect used to parse inner SQL — both the decoded
Value.NativeQuery() text and navigation-chain synthetic
SELECTs. |
TPowerQueryAnalyzer |
withInnerVendorOverride(EDbVendor vendor)
Fallback vendor used only when no connector call is visible in the
document and no explicit vendor was supplied.
|
public TPowerQueryAnalyzer(TPowerQueryDocumentStmt stmt)
public TPowerQueryAnalyzer withInnerVendorOverride(EDbVendor vendor)
public TPowerQueryAnalyzer withExplicitInnerVendor(EDbVendor vendor)
Value.NativeQuery() text and navigation-chain synthetic
SELECTs. When set, this takes precedence over connector-based
inference; when null (default), inference is used.public PowerQueryLineageResult analyze()