Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
RichardJCai opened this issue Feb 11, 2021 · 1 comment · Fixed by #71246
Closed

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

RichardJCai opened this issue Feb 11, 2021 · 1 comment · Fixed by #71246
Assignees
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)

Comments

@RichardJCai
Copy link
Contributor

RichardJCai commented Feb 11, 2021

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.

@RichardJCai RichardJCai added C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) A-sql-execution Relating to SQL execution. labels Feb 11, 2021
@knz
Copy link
Contributor

knz commented Feb 16, 2021

cc @yuzefovich if you have any additional architectural considerations

@rafiss rafiss added the T-sql-foundations SQL Foundations Team (formerly SQL Schema + SQL Sessions) label May 12, 2021
@RichardJCai RichardJCai self-assigned this Oct 11, 2021
@craig craig bot closed this as completed in 8fa3a38 Nov 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants