Class ExpansionResult
Object
gudusoft.gsqlparser.resolver2.expansion.ExpansionResult
Result of star column expansion.
Tracks: - Which star columns were expanded - Which star columns could not be expanded (and why) - Non-star columns (passed through) - Statistics about the expansion
Example:
SELECT t1.*, t2.id, t3.*
FROM t1 JOIN t2 JOIN t3
ExpansionResult:
- expandedStars: {t1.* -> [t1.id, t1.name], t3.* -> [t3.id, t3.status]}
- nonStarColumns: [t2.id]
- unexpandableStars: {}
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddExpandedStar(TResultColumn starColumn, List<ExpandedColumn> expandedColumns) Add a successfully expanded star column.voidaddNonStarColumn(TResultColumn column) Add a non-star column.voidaddUnexpandableStar(TResultColumn starColumn, String reason) Add a star column that could not be expanded.Get all expanded columns (flattened list).intGet the number of star columns that were expanded.Get all expanded stars.Get all non-star columns.Get statistics about the expansion.intGet the total number of columns after expansion.intGet the number of star columns that could not be expanded.Get all unexpandable stars.booleanCheck if any stars were expanded.booleanCheck if all stars were successfully expanded.toString()
-
Constructor Details
-
ExpansionResult
public ExpansionResult()
-
-
Method Details
-
addExpandedStar
Add a successfully expanded star column.- Parameters:
starColumn- the original star columnexpandedColumns- the expanded columns
-
addUnexpandableStar
Add a star column that could not be expanded.- Parameters:
starColumn- the star columnreason- why it could not be expanded
-
addNonStarColumn
Add a non-star column.- Parameters:
column- the non-star column
-
getExpandedStars
Get all expanded stars.- Returns:
- map of star column to expanded columns
-
getUnexpandableStars
Get all unexpandable stars.- Returns:
- map of star column to reason
-
getNonStarColumns
Get all non-star columns.- Returns:
- list of non-star columns
-
getAllExpandedColumns
Get all expanded columns (flattened list).- Returns:
- all expanded columns from all stars
-
getTotalColumnCount
Get the total number of columns after expansion. This includes expanded star columns and non-star columns.- Returns:
- total column count
-
getExpandedStarCount
Get the number of star columns that were expanded.- Returns:
- expanded star count
-
getUnexpandableStarCount
Get the number of star columns that could not be expanded.- Returns:
- unexpandable star count
-
isFullyExpanded
Check if all stars were successfully expanded.- Returns:
- true if no unexpandable stars, false otherwise
-
hasExpandedStars
Check if any stars were expanded.- Returns:
- true if at least one star was expanded
-
getStatistics
Get statistics about the expansion.- Returns:
- statistics string
-
toString
-