@@ -440,6 +440,12 @@ def test_materialized_view(ctx_query_and_df: TestContext):
440440 "which this generic test does not provide; StarRocks MVs are covered by "
441441 "test_integration_starrocks.py"
442442 )
443+ if ctx .engine_adapter .dialect == "doris" :
444+ pytest .skip (
445+ "Doris materialized views require engine-specific properties (SYNC source_table or MTMV DISTRIBUTED BY), "
446+ "which this generic test does not provide; Doris MVs are covered by "
447+ "test_integration_doris.py"
448+ )
443449 input_data = pd .DataFrame (
444450 [
445451 {"id" : 1 , "ds" : "2022-01-01" },
@@ -450,22 +456,8 @@ def test_materialized_view(ctx_query_and_df: TestContext):
450456 source_table = ctx .table ("source_table" )
451457 ctx .engine_adapter .ctas (source_table , ctx .input_data (input_data ), ctx .columns_to_types )
452458 view = ctx .table ("test_view" )
453- # For Doris synchronized materialized views, we need to use only the table name without schema and add the source table name to the table properties
454- if ctx .engine_adapter .dialect == "doris" :
455- view = exp .to_table (view .name )
456- # For Doris, select only the first column name from columns_to_types.
457- # Otherwise, Doris will raise an error if the materialized view has the same schema as the base table.
458- first_column = next (iter (ctx .columns_to_types ))
459- view_query = exp .select (first_column ).from_ (source_table )
460- ctx .engine_adapter .create_view (
461- view ,
462- view_query ,
463- materialized = True ,
464- view_properties = {"materialized_type" : "SYNC" , "source_table" : source_table },
465- )
466- else :
467- view_query = exp .select (* ctx .columns_to_types ).from_ (source_table )
468- ctx .engine_adapter .create_view (view , view_query , materialized = True )
459+ view_query = exp .select (* ctx .columns_to_types ).from_ (source_table )
460+ ctx .engine_adapter .create_view (view , view_query , materialized = True )
469461 results = ctx .get_metadata_results ()
470462 # Redshift considers the underlying dataset supporting materialized views as a table therefore we get 2
471463 # tables in the result
@@ -474,31 +466,13 @@ def test_materialized_view(ctx_query_and_df: TestContext):
474466 else :
475467 assert len (results .tables ) == 1
476468 assert len (results .views ) == 0
477- # Doris information_schema.tables does not show materialized views and cannot query the synchronized materialized view
478- if ctx .engine_adapter .dialect != "doris" :
479- assert len (results .materialized_views ) == 1
480- assert results .materialized_views [0 ] == view .name
481- ctx .compare_with_current (view , input_data )
469+ assert len (results .materialized_views ) == 1
470+ assert results .materialized_views [0 ] == view .name
471+ ctx .compare_with_current (view , input_data )
482472 # Make sure that dropping a materialized view also works
483- if ctx .engine_adapter .dialect == "doris" :
484- # Wait for the materialized view to be created by retrying drop until it succeeds
485- def drop_view_success ():
486- try :
487- ctx .engine_adapter .drop_view (
488- view ,
489- ignore_if_not_exists = False ,
490- materialized = True ,
491- view_properties = {"materialized_type" : "SYNC" , "source_table" : source_table },
492- )
493- return True
494- except Exception :
495- return False
496-
497- wait_until (drop_view_success , attempts = 5 , wait = 1 )
498- else :
499- ctx .engine_adapter .drop_view (view , materialized = True )
500- results = ctx .get_metadata_results ()
501- assert len (results .materialized_views ) == 0
473+ ctx .engine_adapter .drop_view (view , materialized = True )
474+ results = ctx .get_metadata_results ()
475+ assert len (results .materialized_views ) == 0
502476
503477
504478def test_drop_schema (ctx : TestContext ):
@@ -1031,12 +1005,8 @@ def test_merge(ctx_query_and_df: TestContext):
10311005 # Athena only supports MERGE on Iceberg tables
10321006 # And it cant fall back to a logical merge on Hive tables because it cant delete records
10331007 table_format = "iceberg" if ctx .dialect == "athena" else None
1034- # Doris needs to have a UNIQUE KEY to use MERGE
1035- table_properties = {"unique_key" : "id" } if ctx .dialect == "doris" else None
10361008
1037- ctx .engine_adapter .create_table (
1038- table , ctx .columns_to_types , table_format = table_format , table_properties = table_properties
1039- )
1009+ ctx .engine_adapter .create_table (table , ctx .columns_to_types , table_format = table_format )
10401010 input_data = pd .DataFrame (
10411011 [
10421012 {"id" : 1 , "ds" : "2022-01-01" },
@@ -1101,15 +1071,11 @@ def test_merge_source_columns(ctx_query_and_df: TestContext):
11011071 # Athena only supports MERGE on Iceberg tables
11021072 # And it cant fall back to a logical merge on Hive tables because it cant delete records
11031073 table_format = "iceberg" if ctx .dialect == "athena" else None
1104- # Doris needs to have a UNIQUE KEY to use MERGE
1105- table_properties = {"unique_key" : "id" } if ctx .dialect == "doris" else None
11061074
11071075 columns_to_types = ctx .columns_to_types .copy ()
11081076 columns_to_types ["ignored_column" ] = exp .DataType .build ("int" )
11091077
1110- ctx .engine_adapter .create_table (
1111- table , columns_to_types , table_format = table_format , table_properties = table_properties
1112- )
1078+ ctx .engine_adapter .create_table (table , columns_to_types , table_format = table_format )
11131079 input_data = pd .DataFrame (
11141080 [
11151081 {"id" : 1 , "ds" : "2022-01-01" , "ignored_source" : "ignored_value" },
@@ -4058,7 +4024,7 @@ def test_unicode_characters(ctx: TestContext, tmp_path: Path):
40584024 # I also think Spark may not support unicode in general but that would need to be verified.
40594025 if not ctx .engine_adapter .QUOTE_IDENTIFIERS_IN_VIEWS :
40604026 pytest .skip ("Skipping as these engines have issues with unicode characters in model names" )
4061- # Doris default setting `enable_unicode_name_support=false` so it is incompatible with unicode characters in model names
4027+ # Doris static fe.conf setting `enable_unicode_name_support` defaults to false (and is not runtime-mutable)
40624028 if ctx .dialect == "doris" :
40634029 pytest .skip (
40644030 "Skipping as Doris default setting has issues with unicode characters in model names"
0 commit comments