PZ Optimizer Loops Forever if ApplyRule
Fails for Implementing Physical Operator
#130
Labels
bug
Something isn't working
During the execution of
Optimizer.search_optimization_space()
, when the plan is first getting scored, every task toOptimizePhysicalExpression
will create two new tasks:OptimizeGroup
for theinput_group_id(s)
OptimizePhysicalExpression
to re-optimize this physical expression once the input group is optimizedThe
OptimizeGroup
is added to the end of thenew_tasks
so that it will execute first, before the task to re-optimize the physical expression.If the
OptimizeGroup
task fails -- or more precisely, if any task in the sub-tree of tasks which optimize that group fails -- then the optimizer will loop forever, because the call to optimize the physical expression will re-create tasks (1.) and (2.) above, and the cycle repeats forever.We can catch this behavior by checking to see if the
OptimizePhysicalExpression
is being invoked for a 2nd time without the input group having been costed. If we detect this -- we should throw an exception (rather than looping forever)The text was updated successfully, but these errors were encountered: