File tree Expand file tree Collapse file tree 2 files changed +1
-12
lines changed Expand file tree Collapse file tree 2 files changed +1
-12
lines changed Original file line number Diff line number Diff line change @@ -117,17 +117,6 @@ def get_databases(self):
117117 database_list = [row [0 ] for row in databases ]
118118 return database_list
119119
120- def table_exists (self , table_name ):
121- """Check if a specific table exists in the current database"""
122- if self .database not in self .get_databases ():
123- return False
124-
125- query = f"EXISTS TABLE `{ self .database } `.`{ table_name } `"
126- result = self .client .query (query )
127- if result .result_rows and result .result_rows [0 ][0 ] == 1 :
128- return True
129- return False
130-
131120 def validate_database_schema (self , expected_tables ):
132121 """Validates that all expected tables exist in the database and returns missing tables"""
133122 if self .database not in self .get_databases ():
Original file line number Diff line number Diff line change @@ -180,7 +180,7 @@ def run(self):
180180
181181 if self .state .status != Status .NONE :
182182 # ensure target database still exists
183- if self .target_database not in self .clickhouse_api .get_databases ():
183+ if self .target_database not in self .clickhouse_api .get_databases () and f" { self . target_database } _tmp" not in self . clickhouse_api . get_databases () :
184184 logger .warning (f'database { self .target_database } missing in CH' )
185185 logger .warning ('will run replication from scratch' )
186186 self .state .remove ()
You can’t perform that action at this time.
0 commit comments