public class CTENamespace extends AbstractNamespace
columnSources, columnSourcesWithRefs, guessColumnStrategy, nameMatcher, node, referenceTraceabilityEnabled, validated| Constructor and Description |
|---|
CTENamespace(TCTE cte,
String cteName,
TSelectSqlStatement selectStatement) |
CTENamespace(TCTE cte,
String cteName,
TSelectSqlStatement selectStatement,
INameMatcher nameMatcher) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
addInferredColumn(String columnName,
double confidence,
String evidence)
Add an inferred column to this namespace.
|
protected void |
doValidate()
Subclasses override this to perform actual validation logic.
|
List<TTable> |
getAllFinalTables()
Get all final physical tables this namespace depends on.
|
TCTE |
getCTE() |
String |
getDisplayName()
Get a display name for this namespace (for debugging/error messages)
|
List<String> |
getExplicitColumns() |
TTable |
getFinalTable()
Get the final physical table this namespace represents.
|
Set<String> |
getInferredColumns()
Get all columns that were inferred (not from SELECT list directly).
|
MetadataState |
getMetadataState()
Slice S4 (plan §5.5): a CTE's derived schema is authoritative once the
CTE has validated and produced at least one named column source.
|
TTable |
getReferencingTable()
Get the TTable that references this CTE in a FROM clause.
|
TSelectSqlStatement |
getSelectStatement()
Get the underlying SELECT statement for this namespace.
|
TTable |
getSourceTable()
Get the TTable that this namespace is associated with.
|
UnionNamespace |
getUnionNamespace()
Get the UnionNamespace if this CTE's subquery is a UNION.
|
ColumnLevel |
hasAuthoritativeOutputColumn(String columnName)
Binding-diagnostic view of the CTE output schema.
|
ColumnLevel |
hasColumn(String columnName)
Check if a column exists in this namespace.
|
boolean |
hasStarColumn()
Check if this namespace contains a star column (SELECT *).
|
boolean |
isRecursive() |
ColumnSource |
resolveColumn(String columnName)
Resolve a column name to its source.
|
void |
setReferencingTable(TTable table)
Set the TTable that references this CTE in a FROM clause.
|
boolean |
supportsDynamicInference()
Check if this namespace supports dynamic column inference.
|
String |
toString() |
addColumnSource, addColumnSource, containsColumnByMatcher, containsColumnNameByMatcher, enableReferenceTraceability, ensureValidated, getAllColumnSources, getAllUniqueColumns, getColumnReferences, getColumnSourceWithReferences, getGuessColumnStrategy, getNameMatcher, getNode, isReferenceTraceabilityEnabled, isValidated, setGuessColumnStrategy, validateclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetStarColumn, resolveColumnPathpublic CTENamespace(TCTE cte, String cteName, TSelectSqlStatement selectStatement, INameMatcher nameMatcher)
public CTENamespace(TCTE cte, String cteName, TSelectSqlStatement selectStatement)
public String getDisplayName()
INamespacepublic TTable getReferencingTable()
public TTable getSourceTable()
public void setReferencingTable(TTable table)
public TTable getFinalTable()
INamespacepublic List<TTable> getAllFinalTables()
INamespacegetAllFinalTables in interface INamespacegetAllFinalTables in class AbstractNamespaceprotected void doValidate()
AbstractNamespacedoValidate in class AbstractNamespacepublic TSelectSqlStatement getSelectStatement()
INamespacepublic boolean hasStarColumn()
INamespacepublic boolean supportsDynamicInference()
INamespacepublic MetadataState getMetadataState()
SELECT * produce derived columns from the
underlying namespace and only become FOUND when those columns are
known. Recursive CTEs and unresolved cyclic references stay
METADATA_UNAVAILABLE — S9 will refine this contract.nullpublic boolean addInferredColumn(String columnName, double confidence, String evidence)
INamespacecolumnName - the column name to addconfidence - the confidence score (0.0 to 1.0)evidence - description of why this column was inferredpublic Set<String> getInferredColumns()
INamespacepublic ColumnLevel hasAuthoritativeOutputColumn(String columnName)
This deliberately differs from hasColumn(String), which has
legacy compatibility fallbacks that may infer hidden base-table columns
for lineage. Binding diagnostics need the SQL-visible CTE projection:
explicit CTE column names, named projection columns, and star/pushdown
inferred output columns are visible; hidden base-table inferences are
not.
public ColumnLevel hasColumn(String columnName)
INamespacehasColumn in interface INamespacehasColumn in class AbstractNamespacecolumnName - Column name to checkpublic ColumnSource resolveColumn(String columnName)
INamespaceresolveColumn in interface INamespaceresolveColumn in class AbstractNamespacecolumnName - Column name to resolvepublic UnionNamespace getUnionNamespace()
public List<String> getExplicitColumns()
public boolean isRecursive()
public String toString()
toString in class AbstractNamespace