From 91325939bddf6d2fa6988f7924ac79c5e0803694 Mon Sep 17 00:00:00 2001 From: rharding6373 Date: Mon, 30 Jan 2023 16:55:41 -0800 Subject: [PATCH] sql: explain create function op `EXPLAIN CREATE FUNCTION ...` now emits some output instead of failing. Fixes #96046 Epic: none Release note: none --- pkg/sql/logictest/testdata/logic_test/udf | 8 ++++++++ pkg/sql/opt/exec/explain/emit.go | 2 ++ 2 files changed, 10 insertions(+) diff --git a/pkg/sql/logictest/testdata/logic_test/udf b/pkg/sql/logictest/testdata/logic_test/udf index 7685e386689a..0d432a92643d 100644 --- a/pkg/sql/logictest/testdata/logic_test/udf +++ b/pkg/sql/logictest/testdata/logic_test/udf @@ -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 diff --git a/pkg/sql/opt/exec/explain/emit.go b/pkg/sql/opt/exec/explain/emit.go index 68f4fe81cb77..e9f0b1517f35 100644 --- a/pkg/sql/opt/exec/explain/emit.go +++ b/pkg/sql/opt/exec/explain/emit.go @@ -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", @@ -952,6 +953,7 @@ func (e *emitter) emitNodeAttributes(n *Node) error { explainOptOp, explainOp, showTraceOp, + createFunctionOp, createTableOp, createTableAsOp, createViewOp,