@@ -97,13 +97,33 @@ def normalize(self) -> bool:
9797
9898 def init_db (self , drop_old : bool = True ) -> None :
9999 db_cls = self .config .db .init_cls
100+ # Compose a compact, case-unique collection/table name for Doris to avoid cross-case interference
101+ collection_name = None
102+ try :
103+ from .clients import DB
104+ if self .config .db == DB .Doris :
105+ import re , hashlib
106+ # Primary identifier = case-type enum name from CLI (e.g., Performance768D10M)
107+ case_type_name = self .config .case_config .case_id .name
108+ base = f"vdb_{ case_type_name .lower ()} "
109+ # Sanitize to [a-z0-9_]
110+ base = re .sub (r"[^a-z0-9_]+" , "_" , base ).strip ("_" )
111+ # Cap to 63 chars; add short hash if truncated
112+ if len (base ) > 63 :
113+ h = hashlib .md5 (base .encode ()).hexdigest ()[:6 ]
114+ base = f"{ base [:(63 - 7 )]} _{ h } "
115+ collection_name = base
116+ except Exception :
117+ # If anything goes wrong, fall back silently; Doris will use its default name logic
118+ collection_name = None
100119
101120 self .db = db_cls (
102121 dim = self .ca .dataset .data .dim ,
103122 db_config = self .config .db_config .to_dict (),
104123 db_case_config = self .config .db_case_config ,
105124 drop_old = drop_old ,
106125 with_scalar_labels = self .ca .with_scalar_labels ,
126+ ** ({"collection_name" : collection_name } if collection_name else {}),
107127 )
108128
109129 def _pre_run (self , drop_old : bool = True ):
0 commit comments