public class StarPushDownResolver extends Object
This is the GSP Java implementation of the star column push-down mechanism. When an outer query references columns from a CTE or subquery that uses SELECT *, we need to "push down" those column references to infer which columns are needed.
Example scenario:
WITH my_cte AS (SELECT * FROM Employees) SELECT id, name FROM my_cte;
Push-down process: 1. my_cte has SELECT * (star column) 2. Outer query references id, name from my_cte 3. Push down: id and name are "required" columns from the star 4. These columns are inferred to come from Employees table
Key features: - Works with ScopeBuildResult from ScopeBuilder - Multi-level push-down (nested CTEs/subqueries) - Iterative resolution (may need multiple passes) - Confidence scoring based on reference type
| Modifier and Type | Class and Description |
|---|---|
static class |
StarPushDownResolver.PushDownRequest
Represents a column reference that needs to be pushed down.
|
static class |
StarPushDownResolver.PushDownResult
Represents the result of push-down resolution.
|
| Constructor and Description |
|---|
StarPushDownResolver() |
StarPushDownResolver(int maxIterations,
boolean debugLogging) |
StarPushDownResolver(int maxIterations,
boolean debugLogging,
INameMatcher nameMatcher) |
| Modifier and Type | Method and Description |
|---|---|
Map<String,Object> |
getStatistics(StarPushDownResolver.PushDownResult result)
Get statistics about push-down resolution.
|
StarPushDownResolver.PushDownResult |
resolve(ScopeBuildResult scopeBuildResult)
Resolve star columns by pushing down column references.
|
public StarPushDownResolver()
public StarPushDownResolver(int maxIterations, boolean debugLogging)
public StarPushDownResolver(int maxIterations, boolean debugLogging, INameMatcher nameMatcher)
public StarPushDownResolver.PushDownResult resolve(ScopeBuildResult scopeBuildResult)
scopeBuildResult - the scope build result from ScopeBuilderpublic Map<String,Object> getStatistics(StarPushDownResolver.PushDownResult result)