@@ -649,16 +649,6 @@ def _create_table_from_columns(
649649 """
650650 table_properties = kwargs .get ("table_properties" , {})
651651
652- # Set default replication_num to 1 for testing environments if not specified
653- if (
654- "replication_num" not in table_properties
655- and "replication_allocation" not in table_properties
656- ):
657- table_properties ["replication_num" ] = "1"
658- logger .info (
659- f"[Doris] Added default replication_num for testing: { table_properties ['replication_num' ]} "
660- )
661-
662652 # Convert primary_key to unique_key for Doris (Doris doesn't support primary keys)
663653 if primary_key and "unique_key" not in table_properties :
664654 table_properties ["unique_key" ] = primary_key
@@ -688,7 +678,6 @@ def _build_partitioned_by_exp(
688678 ) -> t .Optional [t .Union [exp .PartitionedByProperty , exp .PartitionByRangeProperty , exp .Property ]]:
689679 """Doris supports range and list partition, but sqlglot only supports range partition, so we use PartitionByRangeProperty."""
690680 # Handle partitioned_by_expr from kwargs
691- logging .info (f"[Doris] _build_partitioned_by_exp called with kwargs: { kwargs } " )
692681 partitioned_by_expr = kwargs .get ("partitioned_by_expr" )
693682 create_expressions = None
694683
@@ -861,18 +850,20 @@ def _build_table_properties_exp(
861850 dynamic_partition_props = {
862851 "dynamic_partition.enable" : "true" ,
863852 "dynamic_partition.time_unit" : "DAY" ,
864- "dynamic_partition.history_partition_num " : "400 " ,
865- "dynamic_partition.end" : "7 " ,
853+ "dynamic_partition.start " : "-490 " ,
854+ "dynamic_partition.end" : "10 " ,
866855 "dynamic_partition.prefix" : "p" ,
867856 "dynamic_partition.buckets" : "32" ,
868857 "dynamic_partition.create_history_partition" : "true" ,
869858 }
870859
871860 # Use partition_interval_unit if provided to set the time_unit
872861 if partition_interval_unit :
873- dynamic_partition_props ["dynamic_partition.time_unit" ] = (
874- partition_interval_unit .upper ()
875- )
862+ if hasattr (partition_interval_unit , "value" ):
863+ time_unit = partition_interval_unit .value .upper ()
864+ else :
865+ time_unit = str (partition_interval_unit ).upper ()
866+ dynamic_partition_props ["dynamic_partition.time_unit" ] = time_unit
876867
877868 # Add missing dynamic partition properties to table_properties_copy
878869 for key , value in dynamic_partition_props .items ():
0 commit comments