Skip to content

Commit

Permalink
sql: explain create function op
Browse files Browse the repository at this point in the history
`EXPLAIN CREATE FUNCTION ...` now emits some output instead of failing.

Fixes #96046

Epic: none
Release note: none
  • Loading branch information
rharding6373 committed Jan 31, 2023
1 parent 53f394d commit 9132593
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
8 changes: 8 additions & 0 deletions pkg/sql/logictest/testdata/logic_test/udf
Original file line number Diff line number Diff line change
Expand Up @@ -2923,3 +2923,11 @@ SELECT f95240(a) FROM t95240
----
33
NULL

query T
EXPLAIN CREATE FUNCTION f() RETURNS INT LANGUAGE SQL AS 'SELECT 1'
----
distribution: local
vectorized: true
·
• create function
2 changes: 2 additions & 0 deletions pkg/sql/opt/exec/explain/emit.go
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,7 @@ var nodeNames = [...]string{
controlJobsOp: "control jobs",
controlSchedulesOp: "control schedules",
createStatisticsOp: "create statistics",
createFunctionOp: "create function",
createTableOp: "create table",
createTableAsOp: "create table as",
createViewOp: "create view",
Expand Down Expand Up @@ -952,6 +953,7 @@ func (e *emitter) emitNodeAttributes(n *Node) error {
explainOptOp,
explainOp,
showTraceOp,
createFunctionOp,
createTableOp,
createTableAsOp,
createViewOp,
Expand Down

0 comments on commit 9132593

Please sign in to comment.