@@ -260,10 +260,12 @@ pub struct TableMeta {
260260 pub storage_params : Option < StorageParams > ,
261261 pub part_prefix : String ,
262262 pub options : BTreeMap < String , String > ,
263- // The default cluster key.
264- pub default_cluster_key : Option < String > ,
265- // The sequence number of default_cluster_key.
266- pub default_cluster_key_id : u32 ,
263+ pub cluster_key : Option < String > ,
264+ /// A sequential number that uniquely identifies changes to the cluster key.
265+ /// This value increments by 1 each time the cluster key is created or modified,
266+ /// ensuring a unique identifier for each version of the cluster key.
267+ /// It remains unchanged when the cluster key is dropped.
268+ pub cluster_key_seq : u32 ,
267269 pub created_on : DateTime < Utc > ,
268270 pub updated_on : DateTime < Utc > ,
269271 pub comment : String ,
@@ -408,9 +410,9 @@ impl TableInfo {
408410
409411 pub fn cluster_key ( & self ) -> Option < ( u32 , String ) > {
410412 self . meta
411- . default_cluster_key
413+ . cluster_key
412414 . clone ( )
413- . map ( |k| ( self . meta . default_cluster_key_id , k) )
415+ . map ( |k| ( self . meta . cluster_key_seq , k) )
414416 }
415417}
416418
@@ -423,8 +425,8 @@ impl Default for TableMeta {
423425 storage_params : None ,
424426 part_prefix : "" . to_string ( ) ,
425427 options : BTreeMap :: new ( ) ,
426- default_cluster_key : None ,
427- default_cluster_key_id : 0 ,
428+ cluster_key : None ,
429+ cluster_key_seq : 0 ,
428430 created_on : Utc :: now ( ) ,
429431 updated_on : Utc :: now ( ) ,
430432 comment : "" . to_string ( ) ,
0 commit comments