Skip to content

sql: get rid of InternalExecutor interface in tree package (eval.go) #60507

@RichardJCai

Description

@RichardJCai

We have a disconnect between the InternalExecutor in sql/sem/tree/eval.go and sql/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.

image

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.

Metadata

Metadata

Assignees

Labels

A-sql-executionRelating to SQL execution.C-enhancementSolution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)T-sql-foundationsSQL Foundations Team (formerly SQL Schema + SQL Sessions)

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions