Skip to content

Commit 401b070

Browse files
committed
fix
1 parent ab97450 commit 401b070

28 files changed

+34
-35
lines changed

src/meta/app/src/schema/table.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -260,8 +260,7 @@ 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>,
263+
pub cluster_key: Option<String>,
265264
/// A sequential number that uniquely identifies changes to the cluster key.
266265
/// This value increments by 1 each time the cluster key is created or modified,
267266
/// ensuring a unique identifier for each version of the cluster key.
@@ -411,7 +410,7 @@ impl TableInfo {
411410

412411
pub fn cluster_key(&self) -> Option<(u32, String)> {
413412
self.meta
414-
.default_cluster_key
413+
.cluster_key
415414
.clone()
416415
.map(|k| (self.meta.cluster_key_seq, k))
417416
}
@@ -426,7 +425,7 @@ impl Default for TableMeta {
426425
storage_params: None,
427426
part_prefix: "".to_string(),
428427
options: BTreeMap::new(),
429-
default_cluster_key: None,
428+
cluster_key: None,
430429
cluster_key_seq: 0,
431430
created_on: Utc::now(),
432431
updated_on: Utc::now(),

src/meta/proto-conv/src/table_from_to_protobuf_impl.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ impl FromToProto for mt::TableMeta {
210210
},
211211
part_prefix: p.part_prefix.unwrap_or("".to_string()),
212212
options: p.options,
213-
default_cluster_key: p.default_cluster_key,
213+
cluster_key: p.cluster_key,
214214
cluster_key_seq,
215215
created_on: DateTime::<Utc>::from_pb(p.created_on)?,
216216
updated_on: DateTime::<Utc>::from_pb(p.updated_on)?,
@@ -257,7 +257,7 @@ impl FromToProto for mt::TableMeta {
257257
Some(self.part_prefix.clone())
258258
},
259259
options: self.options.clone(),
260-
default_cluster_key: self.default_cluster_key.clone(),
260+
cluster_key: self.cluster_key.clone(),
261261
// cluster_keys is deprecated.
262262
cluster_keys: vec![],
263263
cluster_key_seq: Some(self.cluster_key_seq),

src/meta/proto-conv/tests/it/proto_conv.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ fn new_table_meta() -> mt::TableMeta {
140140
part_prefix: "".to_string(),
141141
engine_options: btreemap! {s("abc") => s("def")},
142142
options: btreemap! {s("xyz") => s("foo")},
143-
default_cluster_key: Some("(a + 2, b)".to_string()),
143+
cluster_key: Some("(a + 2, b)".to_string()),
144144
cluster_key_seq: 0,
145145
created_on: Utc.with_ymd_and_hms(2014, 11, 28, 12, 0, 9).unwrap(),
146146
updated_on: Utc.with_ymd_and_hms(2014, 11, 29, 12, 0, 10).unwrap(),

src/meta/proto-conv/tests/it/v002_table_meta.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ fn test_decode_v2_table_meta() -> anyhow::Result<()> {
131131
part_prefix: "".to_string(),
132132
engine_options: btreemap! {s("abc") => s("def")},
133133
options: btreemap! {s("xyz") => s("foo")},
134-
default_cluster_key: Some("(a + 2, b)".to_string()),
134+
cluster_key: Some("(a + 2, b)".to_string()),
135135
cluster_key_seq: 0,
136136
created_on: Utc.with_ymd_and_hms(2014, 11, 28, 12, 0, 9).unwrap(),
137137
updated_on: Utc.with_ymd_and_hms(2014, 11, 29, 12, 0, 10).unwrap(),

src/meta/proto-conv/tests/it/v010_table_meta.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ fn test_decode_v10_table_meta() -> anyhow::Result<()> {
133133
storage_params: None,
134134
part_prefix: "".to_string(),
135135
options: btreemap! {s("xyz") => s("foo")},
136-
default_cluster_key: Some("(a + 2, b)".to_string()),
136+
cluster_key: Some("(a + 2, b)".to_string()),
137137
cluster_key_seq: 0,
138138
created_on: Utc.with_ymd_and_hms(2014, 11, 28, 12, 0, 9).unwrap(),
139139
updated_on: Utc.with_ymd_and_hms(2014, 11, 29, 12, 0, 10).unwrap(),

src/meta/proto-conv/tests/it/v012_table_meta.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ fn test_decode_v12_table_meta() -> anyhow::Result<()> {
135135
storage_params: Some(StorageParams::default()),
136136
part_prefix: "".to_string(),
137137
options: btreemap! {s("xyz") => s("foo")},
138-
default_cluster_key: Some("(a + 2, b)".to_string()),
138+
cluster_key: Some("(a + 2, b)".to_string()),
139139
cluster_key_seq: 0,
140140
created_on: Utc.with_ymd_and_hms(2014, 11, 28, 12, 0, 9).unwrap(),
141141
updated_on: Utc.with_ymd_and_hms(2014, 11, 29, 12, 0, 10).unwrap(),

src/meta/proto-conv/tests/it/v023_table_meta.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ fn test_decode_v23_table_meta() -> anyhow::Result<()> {
135135
storage_params: Some(StorageParams::default()),
136136
part_prefix: "lulu_".to_string(),
137137
options: btreemap! {s("xyz") => s("foo")},
138-
default_cluster_key: Some("(a + 2, b)".to_string()),
138+
cluster_key: Some("(a + 2, b)".to_string()),
139139
cluster_key_seq: 0,
140140
created_on: Utc.with_ymd_and_hms(2014, 11, 28, 12, 0, 9).unwrap(),
141141
updated_on: Utc.with_ymd_and_hms(2014, 11, 29, 12, 0, 10).unwrap(),

src/meta/proto-conv/tests/it/v024_table_meta.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ fn test_decode_v24_table_meta() -> anyhow::Result<()> {
135135
storage_params: Some(StorageParams::default()),
136136
part_prefix: "lulu_".to_string(),
137137
options: btreemap! {s("xyz") => s("foo")},
138-
default_cluster_key: Some("(a + 2, b)".to_string()),
138+
cluster_key: Some("(a + 2, b)".to_string()),
139139
cluster_key_seq: 0,
140140
created_on: Utc.with_ymd_and_hms(2014, 11, 28, 12, 0, 9).unwrap(),
141141
updated_on: Utc.with_ymd_and_hms(2014, 11, 29, 12, 0, 10).unwrap(),

src/meta/proto-conv/tests/it/v033_table_meta.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ fn test_decode_v33_table_meta() -> anyhow::Result<()> {
137137
part_prefix: "".to_string(),
138138
engine_options: btreemap! {s("abc") => s("def")},
139139
options: btreemap! {s("xyz") => s("foo")},
140-
default_cluster_key: Some("(a + 2, b)".to_string()),
140+
cluster_key: Some("(a + 2, b)".to_string()),
141141
cluster_key_seq: 0,
142142
created_on: Utc.with_ymd_and_hms(2014, 11, 28, 12, 0, 9).unwrap(),
143143
updated_on: Utc.with_ymd_and_hms(2014, 11, 29, 12, 0, 10).unwrap(),

src/meta/proto-conv/tests/it/v040_table_meta.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ fn test_decode_v40_table_meta() -> anyhow::Result<()> {
137137
part_prefix: "".to_string(),
138138
engine_options: btreemap! {s("abc") => s("def")},
139139
options: btreemap! {s("xyz") => s("foo")},
140-
default_cluster_key: Some("(a + 2, b)".to_string()),
140+
cluster_key: Some("(a + 2, b)".to_string()),
141141
cluster_key_seq: 0,
142142
created_on: Utc.with_ymd_and_hms(2014, 11, 28, 12, 0, 9).unwrap(),
143143
updated_on: Utc.with_ymd_and_hms(2014, 11, 29, 12, 0, 10).unwrap(),

0 commit comments

Comments
 (0)