sql: get rid of InternalExecutor interface in tree package (eval.go) #60507
Labels
A-sql-execution
Relating to SQL execution.
C-enhancement
Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)
T-sql-foundations
SQL Foundations Team (formerly SQL Schema + SQL Sessions)
We have a disconnect between the InternalExecutor in
sql/sem/tree/eval.go
andsql/sqlutil/internal_executor.go
.Currently for all cases, the InternalExecutor in the tree package is downcasted to the InternalExecutor in sqlutil.
The current use cases for the InternalExecutor in the tree package are specific to streamingccl (which likely can use the sqlutil version) and pg_builtins.go.
For the pg_builtins.go, we should expose some logic on the evalContext to allow us to query the datums instead of keeping a separate InternalExecutor interface.
Suggestion by Andrew Werner: wrap QueryRow with a method on the EvalPlanner
It would be better to have a clearly defined interface between InternalExecutor and builtins. For now we can do something like for each usage of InternalExecutor in builtins, replace it with a method on the EvalPlanner to achieve whatever query the InternalExecutor is running. This way we at least have some interface and will not have a leaky abstraction for InternalExecutor.
The text was updated successfully, but these errors were encountered: