MCPcopy Create free account
hub / github.com/bytebase/bytebase / getTemporaryMaterializedView

Function getTemporaryMaterializedView

backend/plugin/db/starrocks/dump.go:248–257  ·  view source on GitHub ↗
(name string, columns []string)

Source from the content-addressed store, hash-verified

246}
247
248func getTemporaryMaterializedView(name string, columns []string) string {
249 var parts []string
250 for _, col := range columns {
251 parts = append(parts, fmt.Sprintf("1 AS `%s`", col))
252 }
253 // For materialized views, we create a temporary regular view as a placeholder
254 // since the actual materialized view will be created later with the full definition.
255 stmt := fmt.Sprintf("CREATE VIEW `%s` AS SELECT\n %s;\n", name, strings.Join(parts, ",\n "))
256 return fmt.Sprintf(tempMaterializedViewStmtFmt, name, stmt)
257}
258
259// TableSchema describes the schema of a table or view.
260type TableSchema struct {

Callers 2

DumpMethod · 0.85

Calls 1

JoinMethod · 0.80