Class GroupByScope
Object
gudusoft.gsqlparser.resolver2.scope.AbstractScope
gudusoft.gsqlparser.resolver2.scope.GroupByScope
- All Implemented Interfaces:
IScope
Scope for GROUP BY clause.
Visibility rules: - Can access columns from FROM scope - Cannot access aggregate functions or SELECT list aliases - In some databases (MySQL), can access SELECT list columns
Example:
SELECT department, COUNT(*) as emp_count FROM employees GROUP BY department -- Can reference employees.department
The GROUP BY scope delegates column resolution to its parent (typically a SelectScope), which has access to the FROM scope.
-
Field Summary
Fields inherited from class gudusoft.gsqlparser.resolver2.scope.AbstractScope
node, parent, scopeType -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGet the FROM scope.voidsetFromScope(IScope fromScope) Set the FROM scope for column resolution.toString()Methods inherited from class gudusoft.gsqlparser.resolver2.scope.AbstractScope
addChild, fullyQualify, getChildren, getNode, getParent, getScopeType, getVisibleNamespaces, isWithin, resolve, resolveTable
-
Constructor Details
-
GroupByScope
-
-
Method Details
-
setFromScope
Set the FROM scope for column resolution. GROUP BY columns should resolve against FROM scope tables.- Parameters:
fromScope- the FROM scope
-
getFromScope
Get the FROM scope.- Returns:
- the FROM scope, or null if not set
-
getGroupByNode
-
toString
- Overrides:
toStringin classAbstractScope
-