Code of Conduct
Search before asking
Describe the feature
Currently, when the system runs in PlanOnlyMode (i.e., only parsing and analyzing SQL without actual execution), some complex SQL statements can cause the logical plan analysis phase to take a very long time, even though no physical execution is triggered.
In extreme cases, Catalyst optimization may consume very high CPU and memory resources during this phase.
I hope the operation can fail fast after a configurable timeout, so that plan analysis does not block the system for an excessive amount of time.
Motivation
Make the statement in PlanOnly mode can timeout.
Describe the solution
Support timeout atPlanOnlyStatement.
Make runInternal run in another thread, then we can cancel it. This differs from the current implementation of other ExecuteStatement methods, since the PlanOnlyStatement can only be cancel by interrupt.
As a long term solution, maybe we can implement a unified timeout monitor at the Engine Operation level. When the timeout is triggered, it uniformly cancels the future of the operation.
Additional context
No response
Are you willing to submit PR?
Code of Conduct
Search before asking
Describe the feature
Currently, when the system runs in PlanOnlyMode (i.e., only parsing and analyzing SQL without actual execution), some complex SQL statements can cause the logical plan analysis phase to take a very long time, even though no physical execution is triggered.
In extreme cases, Catalyst optimization may consume very high CPU and memory resources during this phase.
I hope the operation can fail fast after a configurable timeout, so that plan analysis does not block the system for an excessive amount of time.
Motivation
Make the statement in PlanOnly mode can timeout.
Describe the solution
Support timeout at
PlanOnlyStatement.Make
runInternalrun in another thread, then we can cancel it. This differs from the current implementation of otherExecuteStatementmethods, since thePlanOnlyStatementcan only be cancel by interrupt.As a long term solution, maybe we can implement a unified timeout monitor at the Engine Operation level. When the timeout is triggered, it uniformly cancels the future of the operation.
Additional context
No response
Are you willing to submit PR?