File tree Expand file tree Collapse file tree
tests/integration/helpers Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -342,12 +342,22 @@ def assert_nested_table_is_created(
342342 table = schema_name + "." + table_name
343343
344344 print (f"Checking table { table } exists in { materialized_database } " )
345- database_tables = instance .query (f"SHOW TABLES FROM `{ materialized_database } `" )
346345
347- while table not in database_tables :
348- time .sleep (0.2 )
349- database_tables = instance .query (f"SHOW TABLES FROM `{ materialized_database } `" )
346+ # Check based on `system.tables` is not enough, because tables appear there before they are loaded.
347+ # It may lead to error `Unknown table expression identifier...`
348+ while True :
349+ try :
350+ instance .query (
351+ f"SELECT * FROM `{ materialized_database } `.`{ table } ` LIMIT 1 FORMAT Null"
352+ )
353+ break
354+ except Exception :
355+ time .sleep (0.2 )
356+ continue
350357
358+ database_tables = instance .query (
359+ f"SHOW TABLES FROM `{ materialized_database } ` WHERE name = '{ table } '"
360+ )
351361 assert table in database_tables
352362
353363
You can’t perform that action at this time.
0 commit comments