Class NamespaceEnhancer
Object
gudusoft.gsqlparser.resolver2.enhancement.NamespaceEnhancer
Handles explicit namespace enhancement between resolution passes.
The enhancement process:
1. During resolution, collect column references that target namespaces with star columns
2. Between passes, explicitly add these columns to the namespaces
3. Track which columns were added in which pass for debugging
This makes the column inference process explicit and traceable, rather than
happening implicitly during resolution.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcollectColumnRef(String columnName, INamespace targetNamespace, TObjectName sourceReference, double confidence, String evidence) Deprecated.voidcollectColumnRef(String columnName, INamespace targetNamespace, TObjectName sourceReference, ResolutionEvidence evidenceDetail) Collect a column reference with structured evidence.voidcollectFromResolution(TObjectName column, ResolutionResult result, INamespace candidateNamespace) Collect a column reference based on resolution result.enhance()Perform namespace enhancement using collected column references.Generate a summary report of all enhancementsGet all enhancement results historyintGet number of pending references (not yet enhanced)Get all star namespacesintGet total columns added across all passesvoidinitialize(ScopeBuildResult scopeBuildResult) Initialize the enhancer with scope build result.booleanisStarNamespace(INamespace namespace) Check if a namespace is a star namespacevoidstartPass(int passNumber) Start a new resolution pass.
-
Constructor Details
-
NamespaceEnhancer
public NamespaceEnhancer() -
NamespaceEnhancer
-
-
Method Details
-
initialize
Initialize the enhancer with scope build result. Caches namespaces that have star columns and builds TTable -> INamespace mapping. -
startPass
Start a new resolution pass. Clears pending references from previous pass. -
collectColumnRef
public void collectColumnRef(String columnName, INamespace targetNamespace, TObjectName sourceReference, double confidence, String evidence) Deprecated.Collect a column reference that could not be resolved. Called during resolution when a column targets a star namespace.- Parameters:
columnName- The column nametargetNamespace- The namespace the column should belong tosourceReference- The AST nodeconfidence- Confidence scoreevidence- Reason for this inference
-
collectColumnRef
public void collectColumnRef(String columnName, INamespace targetNamespace, TObjectName sourceReference, ResolutionEvidence evidenceDetail) Collect a column reference with structured evidence. Called during resolution when a column targets a star namespace.- Parameters:
columnName- The column nametargetNamespace- The namespace the column should belong tosourceReference- The AST nodeevidenceDetail- Structured evidence detail
-
collectFromResolution
public void collectFromResolution(TObjectName column, ResolutionResult result, INamespace candidateNamespace) Collect a column reference based on resolution result. Automatically determines if collection is needed based on resolution status. -
enhance
Perform namespace enhancement using collected column references. This is called BETWEEN resolution passes.- Returns:
- EnhancementResult with details of what was added
-
getEnhancementHistory
Get all enhancement results history -
getTotalColumnsAdded
Get total columns added across all passes -
getPendingCount
Get number of pending references (not yet enhanced) -
isStarNamespace
Check if a namespace is a star namespace -
getStarNamespaces
Get all star namespaces -
generateReport
Generate a summary report of all enhancements
-
collectColumnRef(String, INamespace, TObjectName, ResolutionEvidence)instead