public class AdaptiveResolutionStrategy extends Object implements ResolutionStrategy
This strategy analyzes the resolution progress and adapts its behavior: - If progress is good: Continue with current approach - If progress stalls: Enable more aggressive techniques (inference, expansion) - If query is complex: Use more iterations - If query is simple: Use fewer iterations
Adaptation criteria: - Resolution rate (% of columns resolved) - Progress per pass (columns resolved in each iteration) - Query complexity (number of CTEs, subqueries, etc.)
Example behavior:
Simple query (SELECT a, b FROM t1): Pass 1: 100% resolved -> STOP (no need for more passes) Complex query (multiple nested CTEs): Pass 1: 30% resolved -> continue Pass 2: 60% resolved -> enable inference Pass 3: 85% resolved -> enable aggressive expansion Pass 4: 95% resolved -> final cleanup
| Modifier and Type | Class and Description |
|---|---|
static class |
AdaptiveResolutionStrategy.AdaptiveState
Adaptive states.
|
| Constructor and Description |
|---|
AdaptiveResolutionStrategy() |
| Modifier and Type | Method and Description |
|---|---|
AdaptiveResolutionStrategy.AdaptiveState |
getCurrentState()
Get the current adaptive state.
|
String |
getDescription()
Get a description of this strategy.
|
String |
getName()
Get the name of this strategy.
|
void |
preparePass(int passNumber,
ResolutionStatistics previousStats)
Prepare for a new pass.
|
boolean |
shouldExpandStars(int passNumber,
ResolutionStatistics previousStats)
Determine if this strategy should expand star columns in the current pass.
|
boolean |
shouldPerformInference(int passNumber,
ResolutionStatistics previousStats)
Determine if this strategy should perform inference in the current pass.
|
boolean |
shouldPushDownColumns(int passNumber,
ResolutionStatistics previousStats)
Determine if this strategy should push down column requirements in the current pass.
|
String |
toString() |
public AdaptiveResolutionStrategy()
public String getName()
ResolutionStrategygetName in interface ResolutionStrategypublic boolean shouldPerformInference(int passNumber, ResolutionStatistics previousStats)
ResolutionStrategyshouldPerformInference in interface ResolutionStrategypassNumber - the current pass numberpreviousStats - statistics from previous pass (null for first pass)public boolean shouldExpandStars(int passNumber, ResolutionStatistics previousStats)
ResolutionStrategyshouldExpandStars in interface ResolutionStrategypassNumber - the current pass numberpreviousStats - statistics from previous pass (null for first pass)public boolean shouldPushDownColumns(int passNumber, ResolutionStatistics previousStats)
ResolutionStrategyshouldPushDownColumns in interface ResolutionStrategypassNumber - the current pass numberpreviousStats - statistics from previous pass (null for first pass)public void preparePass(int passNumber, ResolutionStatistics previousStats)
ResolutionStrategypreparePass in interface ResolutionStrategypassNumber - the upcoming pass numberpreviousStats - statistics from previous pass (null for first pass)public String getDescription()
ResolutionStrategygetDescription in interface ResolutionStrategypublic AdaptiveResolutionStrategy.AdaptiveState getCurrentState()