diff --git a/pkg/sql/execinfrapb/BUILD.bazel b/pkg/sql/execinfrapb/BUILD.bazel index 4de7ab4c9f86..8eb5433c4b23 100644 --- a/pkg/sql/execinfrapb/BUILD.bazel +++ b/pkg/sql/execinfrapb/BUILD.bazel @@ -83,6 +83,7 @@ go_test( "//pkg/sql/types", "//pkg/util/leaktest", "//pkg/util/optional", + "@com_github_stretchr_testify//require", ], ) diff --git a/pkg/sql/execinfrapb/flow_diagram.go b/pkg/sql/execinfrapb/flow_diagram.go index b05e466dd930..0d1ad99acdd5 100644 --- a/pkg/sql/execinfrapb/flow_diagram.go +++ b/pkg/sql/execinfrapb/flow_diagram.go @@ -513,6 +513,17 @@ func (post *PostProcessSpec) summary() []string { return res } +// summary implements the diagramCellType interface. +func (c *RestoreDataSpec) summary() (string, []string) { + return "RestoreDataSpec", []string{} +} + +// summary implements the diagramCellType interface. +func (c *SplitAndScatterSpec) summary() (string, []string) { + detail := fmt.Sprintf("%d chunks", len(c.Chunks)) + return "SplitAndScatterSpec", []string{detail} +} + // summary implements the diagramCellType interface. func (c *ReadImportDataSpec) summary() (string, []string) { ss := make([]string, 0, len(c.Uri)) @@ -522,6 +533,21 @@ func (c *ReadImportDataSpec) summary() (string, []string) { return "ReadImportData", ss } +// summary implements the diagramCellType interface. +func (s *StreamIngestionDataSpec) summary() (string, []string) { + return "StreamIngestionData", []string{} +} + +// summary implements the diagramCellType interface. +func (s *StreamIngestionFrontierSpec) summary() (string, []string) { + return "StreamIngestionFrontier", []string{} +} + +// summary implements the diagramCellType interface. +func (s *IndexBackfillMergerSpec) summary() (string, []string) { + return "IndexBackfillMerger", []string{} +} + // summary implements the diagramCellType interface. func (s *ExportSpec) summary() (string, []string) { return "Exporter", []string{s.Destination} diff --git a/pkg/sql/execinfrapb/flow_diagram_test.go b/pkg/sql/execinfrapb/flow_diagram_test.go index 68162133bd3e..31751826f32a 100644 --- a/pkg/sql/execinfrapb/flow_diagram_test.go +++ b/pkg/sql/execinfrapb/flow_diagram_test.go @@ -20,6 +20,7 @@ import ( "github.com/cockroachdb/cockroach/pkg/base" "github.com/cockroachdb/cockroach/pkg/sql/catalog/descpb" "github.com/cockroachdb/cockroach/pkg/util/leaktest" + "github.com/stretchr/testify/require" ) // compareDiagrams verifies that two JSON strings decode to equal diagramData @@ -404,3 +405,10 @@ func TestPlanDiagramJoin(t *testing.T) { compareDiagrams(t, s, expected) } + +func TestProcessorsImplementDiagramCellType(t *testing.T) { + pcu := reflect.ValueOf(ProcessorCoreUnion{}) + for i := 0; i < pcu.NumField(); i++ { + require.Implements(t, (*diagramCellType)(nil), pcu.Field(i).Interface()) + } +}