diff --git a/misc/python/materialize/checks/all_checks/source_tables.py b/misc/python/materialize/checks/all_checks/source_tables.py index c36bb1eb8af12..279ede6a4022e 100644 --- a/misc/python/materialize/checks/all_checks/source_tables.py +++ b/misc/python/materialize/checks/all_checks/source_tables.py @@ -28,6 +28,7 @@ class TableFromPgSource(TableFromSourceBase): suffix = "tbl_from_pg_source" def initialize(self) -> Testdrive: + return Testdrive( self.generic_setup() + dedent( diff --git a/src/adapter-types/src/dyncfgs.rs b/src/adapter-types/src/dyncfgs.rs index 0ab56c9b41144..795a342f284a4 100644 --- a/src/adapter-types/src/dyncfgs.rs +++ b/src/adapter-types/src/dyncfgs.rs @@ -128,5 +128,4 @@ pub fn all_dyncfgs(configs: ConfigSet) -> ConfigSet { .add(&DEFAULT_SINK_PARTITION_STRATEGY) .add(&ENABLE_CONTINUAL_TASK_BUILTINS) .add(&ENABLE_EXPRESSION_CACHE) - .add(&ENABLE_SOURCE_TABLE_MIGRATION) } diff --git a/src/adapter/src/catalog/apply.rs b/src/adapter/src/catalog/apply.rs index d1f44926fef89..306ac6cf3ba47 100644 --- a/src/adapter/src/catalog/apply.rs +++ b/src/adapter/src/catalog/apply.rs @@ -25,7 +25,7 @@ use mz_catalog::builtin::{ use mz_catalog::durable::objects::{ ClusterKey, DatabaseKey, DurableType, ItemKey, NetworkPolicyKey, RoleKey, SchemaKey, }; -use mz_catalog::durable::{CatalogError, SystemObjectMapping}; +use mz_catalog::durable::{CatalogError, SystemObjectMapping}; use mz_catalog::memory::error::{Error, ErrorKind}; use mz_catalog::memory::objects::{ CatalogEntry, CatalogItem, Cluster, ClusterReplica, DataSourceDesc, Database, Func, Index, Log, diff --git a/src/adapter/src/catalog/migrate.rs b/src/adapter/src/catalog/migrate.rs index c89dfb44fd2f5..e9feb0a251c5f 100644 --- a/src/adapter/src/catalog/migrate.rs +++ b/src/adapter/src/catalog/migrate.rs @@ -11,10 +11,10 @@ use std::collections::BTreeMap; use mz_catalog::builtin::BuiltinTable; use mz_catalog::durable::{ - shard_id, Transaction, Item, BUILTIN_MIGRATION_SEED, BUILTIN_MIGRATION_SHARD_KEY, + shard_id, Transaction, BUILTIN_MIGRATION_SEED, BUILTIN_MIGRATION_SHARD_KEY, EXPRESSION_CACHE_SEED, EXPRESSION_CACHE_SHARD_KEY, }; -use mz_catalog::memory::objects::{StateUpdate,BootstrapStateUpdateKind}; +use mz_catalog::memory::objects::{BootstrapStateUpdateKind, StateUpdate}; use mz_ore::collections::CollectionExt; use mz_ore::now::NowFn; use mz_persist_types::ShardId; @@ -35,7 +35,7 @@ fn rewrite_ast_items(tx: &mut Transaction<'_>, mut f: F) -> Result<(), anyhow where F: for<'a> FnMut( &'a mut Transaction<'_>, - GlobalId, + CatalogItemId, &'a mut Statement, ) -> Result<(), anyhow::Error>, { @@ -43,8 +43,8 @@ where for mut item in tx.get_items() { let mut stmt = mz_sql::parse::parse(&item.create_sql)?.into_element().ast; - // TODO(alter_table): Switch this to CatalogItemId. - f(tx, item.global_id, &mut stmt).await?; + f(tx, item.id, &mut stmt)?; + item.create_sql = stmt.to_ast_string_stable(); updated_items.insert(item.id, item); @@ -114,8 +114,7 @@ pub(crate) async fn migrate( ast_rewrite_sources_to_tables(tx, now)?; } - rewrite_ast_items(tx, |tx, item, stmt, all_items_and_statements| { - let now = now.clone(); + rewrite_ast_items(tx, |_tx, _id, _stmt| { // Add per-item AST migrations below. // // Each migration should be a function that takes `stmt` (the AST @@ -125,7 +124,7 @@ pub(crate) async fn migrate( // Migration functions may also take `tx` as input to stage // arbitrary changes to the catalog. - Ok(()) + Ok(()) })?; // Load items into catalog. We make sure to consolidate the old updates with the new updates to