public class UnionNamespace extends AbstractNamespace
columnSources, columnSourcesWithRefs, guessColumnStrategy, nameMatcher, node, referenceTraceabilityEnabled, validated| Constructor and Description |
|---|
UnionNamespace(TSelectSqlStatement unionQuery,
String alias,
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<TSelectSqlStatement> |
getAllBranches()
Get all branch SELECT statements.
|
List<TTable> |
getAllFinalTables()
Get all final physical tables this namespace depends on.
|
int |
getBranchCount()
Get the number of UNION branches.
|
List<SubqueryNamespace> |
getBranchNamespaces()
Get all branch namespaces.
|
String |
getDisplayName()
Get a display name for this namespace (for debugging/error messages)
|
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 set-operation's output schema is defined by the
first branch (SQL standard, see class javadoc).
|
TSelectSqlStatement |
getSelectStatement()
Get the underlying SELECT statement for this namespace.
|
ColumnLevel |
hasAuthoritativeOutputColumn(String columnName)
Binding-diagnostic view of the set-operation 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 *).
|
ColumnSource |
resolveColumn(String columnName)
Resolve a column name to its source.
|
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, waitgetSourceTable, getStarColumn, resolveColumnPathpublic UnionNamespace(TSelectSqlStatement unionQuery, String alias, INameMatcher nameMatcher)
public String getDisplayName()
INamespacepublic TTable getFinalTable()
INamespacepublic List<TTable> getAllFinalTables()
INamespacegetAllFinalTables in interface INamespacegetAllFinalTables in class AbstractNamespaceprotected void doValidate()
AbstractNamespacedoValidate in class AbstractNamespacepublic ColumnLevel hasColumn(String columnName)
INamespacehasColumn in interface INamespacehasColumn in class AbstractNamespacecolumnName - Column name to checkpublic ColumnLevel hasAuthoritativeOutputColumn(String columnName)
SQL exposes set-operation columns using the first branch's output
names. Branch-local names from later operands are not visible to an
outer query. When any branch contains SELECT *, the output
shape is not authoritative for missing-output diagnostics.
public ColumnSource resolveColumn(String columnName)
INamespaceresolveColumn in interface INamespaceresolveColumn in class AbstractNamespacecolumnName - Column name to resolvepublic TSelectSqlStatement getSelectStatement()
INamespacepublic boolean hasStarColumn()
INamespacepublic boolean supportsDynamicInference()
INamespacepublic MetadataState getMetadataState()
SELECT * we treat
the output as METADATA_UNAVAILABLE because position-based column
matching across branches has not yet completed. S11 will refine this
once arity-mismatch handling lands.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 List<SubqueryNamespace> getBranchNamespaces()
public List<TSelectSqlStatement> getAllBranches()
public int getBranchCount()
public String toString()
toString in class AbstractNamespace