public final class DynamicSqlSite extends Object
DataFlowAnalyzer, together with whether the analyzer
could statically resolve it. Recording a site never mutates the core lineage model; consumers
may use its proof IDs to project a trustworthy subset of that already-computed model.
DynamicSqlSite.Status is observation-mode-aware:
RESOLVED — a complete materialization parsed. In LEGACY mode this also preserves
the historical classification of some incomplete sites for compatibility.PARTIAL — SHADOW analyzed incomplete text and retained the historical candidate
relationships; getUnprovenRelationshipCount() counts candidates whose
per-edge proof is not available.PARSE_ERROR — a fully-known dynamic string whose parse() failed.UNRESOLVED — no usable candidate lineage was produced.LEGACY's three original states correspond to the internal v2 extraction
states (RESOLVED / AMBIGUOUS / PARSE_ERROR); PARTIAL is an
additive SHADOW-only diagnostic state.
Positions follow the GSP convention: 1-based, end-exclusive, tagged with the per-statement
file hash (same shape as ErrorInfo).
For SHADOW consumers that must publish only independently proven
relationships, getObservedRelationshipIds() identifies the full
relationship delta attributed to this site and
getProvenRelationshipIds() identifies the subset backed by a
complete, hole-free materialization. IDs are scoped to this analyzer result
and correspond to relationship IDs in non-simple dataflow output.
| Modifier and Type | Class and Description |
|---|---|
static class |
DynamicSqlSite.Kind
The syntactic form of the dynamic-exec site.
|
static class |
DynamicSqlSite.Status
Completeness/publication state of this dynamic SQL site.
|
| Constructor and Description |
|---|
DynamicSqlSite(DynamicSqlSite.Kind kind,
DynamicSqlSite.Status status,
String reason,
Pair3<Long,Long,String> startPosition,
Pair3<Long,Long,String> endPosition,
int resolvedRelationshipCount,
int partialRelationshipCount) |
DynamicSqlSite(DynamicSqlSite.Kind kind,
DynamicSqlSite.Status status,
String reason,
Pair3<Long,Long,String> startPosition,
Pair3<Long,Long,String> endPosition,
int resolvedRelationshipCount,
int partialRelationshipCount,
int unprovenRelationshipCount,
int unresolvedHoleCount,
boolean holeCountExact,
DynamicSqlTrustMode trustMode) |
DynamicSqlSite(DynamicSqlSite.Kind kind,
DynamicSqlSite.Status status,
String reason,
Pair3<Long,Long,String> startPosition,
Pair3<Long,Long,String> endPosition,
int resolvedRelationshipCount,
int partialRelationshipCount,
int unprovenRelationshipCount,
int unresolvedHoleCount,
boolean holeCountExact,
DynamicSqlTrustMode trustMode,
List<Long> observedRelationshipIds,
List<Long> provenRelationshipIds) |
DynamicSqlSite(DynamicSqlSite.Kind kind,
DynamicSqlSite.Status status,
String reason,
Pair3<Long,Long,String> startPosition,
Pair3<Long,Long,String> endPosition,
int resolvedRelationshipCount,
int partialRelationshipCount,
int unprovenRelationshipCount,
int unresolvedHoleCount,
boolean holeCountExact,
DynamicSqlTrustMode trustMode,
List<Long> observedRelationshipIds,
List<Long> provenRelationshipIds,
String diagnostic) |
DynamicSqlSite(DynamicSqlSite.Kind kind,
DynamicSqlSite.Status status,
String reason,
Pair3<Long,Long,String> startPosition,
Pair3<Long,Long,String> endPosition,
int resolvedRelationshipCount,
int partialRelationshipCount,
int unprovenRelationshipCount,
int unresolvedHoleCount,
boolean holeCountExact,
DynamicSqlTrustMode trustMode,
List<Long> observedRelationshipIds,
List<Long> provenRelationshipIds,
String diagnostic,
List<UnresolvedFragment> unresolvedFragments,
String materializedText) |
| Modifier and Type | Method and Description |
|---|---|
String |
getDiagnostic()
Additive analysis note, kept separate from an unresolved reason.
|
Pair3<Long,Long,String> |
getEndPosition() |
DynamicSqlSite.Kind |
getKind() |
String |
getMaterializedText()
The argument as the evaluator materialized it, with every hole rendered as its
UnresolvedFragment.getText() (a compile-time literal argument is its own
text); null when the evaluator did not see the site or the argument did not
reduce to a string at all - the holes are still listed, but there is no honest
rendering of an unreduced value. |
List<Long> |
getObservedRelationshipIds()
Relationship IDs attributed to this site, including unproven SHADOW candidates.
|
int |
getPartialRelationshipCount()
Number of lineage edges this site produced into an unresolved target — a T-SQL variable or
placeholder (e.g.
|
List<Long> |
getProvenRelationshipIds()
Relationship IDs whose analyzed text was complete, parsed, and contained
no unresolved provenance holes or placeholder targets.
|
String |
getReason()
Human-readable explanation;
null for DynamicSqlSite.Status.RESOLVED. |
int |
getResolvedRelationshipCount()
Number of lineage edges this site produced into a real target column (a resolved base-table
column, not a T-SQL variable or placeholder).
|
Pair3<Long,Long,String> |
getStartPosition() |
DynamicSqlSite.Status |
getStatus() |
DynamicSqlTrustMode |
getTrustMode() |
int |
getUnprovenRelationshipCount()
Historical candidate relationships SHADOW observed on incomplete text without a per-edge proof.
|
List<UnresolvedFragment> |
getUnresolvedFragments()
The unresolved fragments ("holes") of this site's argument, one per non-literal
fragment of its materialization, in string order: which variable / parameter /
expression the evaluator could not fold, why, where its value would come from, and
the origin span to highlight.
|
int |
getUnresolvedHoleCount()
Number of unresolved splice fragments, or
-1 when the producer exposes only a
partial flag. |
boolean |
isHoleCountExact() |
boolean |
producedLineage()
True iff this site produced at least one resolved lineage edge (into a real target column).
|
public DynamicSqlSite(DynamicSqlSite.Kind kind, DynamicSqlSite.Status status, String reason, Pair3<Long,Long,String> startPosition, Pair3<Long,Long,String> endPosition, int resolvedRelationshipCount, int partialRelationshipCount)
public DynamicSqlSite(DynamicSqlSite.Kind kind, DynamicSqlSite.Status status, String reason, Pair3<Long,Long,String> startPosition, Pair3<Long,Long,String> endPosition, int resolvedRelationshipCount, int partialRelationshipCount, int unprovenRelationshipCount, int unresolvedHoleCount, boolean holeCountExact, DynamicSqlTrustMode trustMode)
public DynamicSqlSite(DynamicSqlSite.Kind kind, DynamicSqlSite.Status status, String reason, Pair3<Long,Long,String> startPosition, Pair3<Long,Long,String> endPosition, int resolvedRelationshipCount, int partialRelationshipCount, int unprovenRelationshipCount, int unresolvedHoleCount, boolean holeCountExact, DynamicSqlTrustMode trustMode, List<Long> observedRelationshipIds, List<Long> provenRelationshipIds)
public DynamicSqlSite(DynamicSqlSite.Kind kind, DynamicSqlSite.Status status, String reason, Pair3<Long,Long,String> startPosition, Pair3<Long,Long,String> endPosition, int resolvedRelationshipCount, int partialRelationshipCount, int unprovenRelationshipCount, int unresolvedHoleCount, boolean holeCountExact, DynamicSqlTrustMode trustMode, List<Long> observedRelationshipIds, List<Long> provenRelationshipIds, String diagnostic)
public DynamicSqlSite(DynamicSqlSite.Kind kind, DynamicSqlSite.Status status, String reason, Pair3<Long,Long,String> startPosition, Pair3<Long,Long,String> endPosition, int resolvedRelationshipCount, int partialRelationshipCount, int unprovenRelationshipCount, int unresolvedHoleCount, boolean holeCountExact, DynamicSqlTrustMode trustMode, List<Long> observedRelationshipIds, List<Long> provenRelationshipIds, String diagnostic, List<UnresolvedFragment> unresolvedFragments, String materializedText)
public DynamicSqlSite.Kind getKind()
public DynamicSqlSite.Status getStatus()
public String getReason()
null for DynamicSqlSite.Status.RESOLVED.public String getDiagnostic()
public Pair3<Long,Long,String> getStartPosition()
public Pair3<Long,Long,String> getEndPosition()
public int getResolvedRelationshipCount()
> 0 iff the site's dynamic SQL yielded usable lineage.public int getPartialRelationshipCount()
EXEC sp_executesql @sql folded to INSERT INTO @t SELECT ...). These
are partial: a source is known but the target object is not.public int getUnprovenRelationshipCount()
public int getUnresolvedHoleCount()
-1 when the producer exposes only a
partial flag. Whenever getUnresolvedFragments() is non-empty this IS its size
and isHoleCountExact() is true; an exact positive count with an empty list
can only come from a producer that counted without listing (none in GSP itself).public boolean isHoleCountExact()
public List<UnresolvedFragment> getUnresolvedFragments()
isHoleCountExact() to tell
"no holes" from "not known".public String getMaterializedText()
UnresolvedFragment.getText() (a compile-time literal argument is its own
text); null when the evaluator did not see the site or the argument did not
reduce to a string at all - the holes are still listed, but there is no honest
rendering of an unreduced value.public DynamicSqlTrustMode getTrustMode()
public List<Long> getObservedRelationshipIds()
public List<Long> getProvenRelationshipIds()
public boolean producedLineage()
getStatus() and getUnprovenRelationshipCount() before
treating those edges as proven. A site with only unresolved-target edges or no edge returns false.