markMaterializedViews re-tags rows that are actually materialized views so the dump emits SHOW CREATE MATERIALIZED VIEW for them. Doris reports MVs as 'BASE TABLE' and StarRocks as 'VIEW'; either becomes 'MATERIALIZED VIEW' when its name is in the materialized-view set. Regular tables and views are
(tables []*TableSchema, materializedViewNames map[string]bool)
| 402 | // StarRocks as 'VIEW'; either becomes 'MATERIALIZED VIEW' when its name is in the |
| 403 | // materialized-view set. Regular tables and views are left untouched. |
| 404 | func markMaterializedViews(tables []*TableSchema, materializedViewNames map[string]bool) { |
| 405 | for _, tbl := range tables { |
| 406 | if !materializedViewNames[tbl.Name] { |
| 407 | continue |
| 408 | } |
| 409 | if tbl.TableType == baseTableType || tbl.TableType == viewTableType { |
| 410 | tbl.TableType = materializedViewType |
| 411 | } |
| 412 | } |
| 413 | } |
| 414 | |
| 415 | // getTableStmt gets the create statement of a table. |
| 416 | func getTableStmt(db *sql.DB, dbName, tblName, tblType string) (string, error) { |
no outgoing calls