Class ResolutionContext
Object
gudusoft.gsqlparser.resolver2.model.ResolutionContext
Global context for resolution results.
Provides efficient querying and statistics about resolved columns.
Design principles:
1. Reverse indexing for O(1) queries
2. Categorized storage for quick access to different resolution states
3. Statistics for monitoring resolution quality
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Clear all data (for reuse or testing)Get all tables that have been referencedGet all ambiguous columnsgetColumnsByName(String columnName) Find all column references with a given name (for conflict detection).Get all exactly matched columnsgetReferencesTo(TTable table) Get all column references to a specific table.getReferencesTo(TTable table, String columnName) Get all column references to a specific table.column.getResolution(TObjectName objName) Get resolution result for a specific TObjectNameGet resolution statisticsintgetTableReferenceCount(TTable table) Get reference count for a specific tableGet all unresolved columnsvoidregisterResolution(TObjectName objName, ResolutionResult result) Register a resolution result.
-
Constructor Details
-
ResolutionContext
public ResolutionContext()
-
-
Method Details
-
registerResolution
Register a resolution result. Called by NameResolver when a column is resolved. -
getReferencesTo
Get all column references to a specific table. Complexity: O(1)- Parameters:
table- Target table- Returns:
- List of TObjectName referencing that table
-
getReferencesTo
Get all column references to a specific table.column. Complexity: O(m) where m = number of references to the table- Parameters:
table- Target tablecolumnName- Target column name- Returns:
- List of matching TObjectName
-
getColumnsByName
Find all column references with a given name (for conflict detection). Complexity: O(1) -
getExactMatches
Get all exactly matched columns -
getAmbiguousColumns
Get all ambiguous columns -
getUnresolvedColumns
Get all unresolved columns -
getTableReferenceCount
Get reference count for a specific table -
getAllReferencedTables
Get all tables that have been referenced -
getStatistics
Get resolution statistics -
getResolution
Get resolution result for a specific TObjectName -
clear
Clear all data (for reuse or testing)
-