@@ -31,7 +31,6 @@ use crate::meta::format::MetaCompression;
31
31
use crate :: meta:: monotonically_increased_timestamp;
32
32
use crate :: meta:: trim_timestamp_to_micro_second;
33
33
use crate :: meta:: v2;
34
- use crate :: meta:: v2:: StatisticsMessagePack ;
35
34
use crate :: meta:: v3;
36
35
use crate :: meta:: ClusterKey ;
37
36
use crate :: meta:: FormatVersion ;
@@ -90,39 +89,6 @@ pub struct TableSnapshot {
90
89
pub table_statistics_location : Option < String > ,
91
90
}
92
91
93
- /// An exact copy of `TableSnapshot` with specific `deserialize_with` implementation
94
- /// in `summary` that can correctly deserialize legacy MessagePack format.
95
- #[ derive( Deserialize ) ]
96
- pub struct TableSnapshotMessagePack {
97
- format_version : FormatVersion ,
98
- snapshot_id : SnapshotId ,
99
- timestamp : Option < DateTime < Utc > > ,
100
- prev_table_seq : Option < u64 > ,
101
- prev_snapshot_id : Option < ( SnapshotId , FormatVersion ) > ,
102
- schema : TableSchema ,
103
- summary : StatisticsMessagePack ,
104
- segments : Vec < Location > ,
105
- cluster_key_meta : Option < ClusterKey > ,
106
- table_statistics_location : Option < String > ,
107
- }
108
-
109
- impl From < TableSnapshotMessagePack > for TableSnapshot {
110
- fn from ( v : TableSnapshotMessagePack ) -> Self {
111
- Self {
112
- format_version : v. format_version ,
113
- snapshot_id : v. snapshot_id ,
114
- timestamp : v. timestamp ,
115
- prev_table_seq : v. prev_table_seq ,
116
- prev_snapshot_id : v. prev_snapshot_id ,
117
- schema : v. schema ,
118
- summary : v. summary . into ( ) ,
119
- segments : v. segments ,
120
- cluster_key_meta : v. cluster_key_meta ,
121
- table_statistics_location : v. table_statistics_location ,
122
- }
123
- }
124
- }
125
-
126
92
impl TableSnapshot {
127
93
pub fn new (
128
94
snapshot_id : SnapshotId ,
@@ -243,18 +209,7 @@ impl TableSnapshot {
243
209
let compression = MetaCompression :: try_from ( r. read_scalar :: < u8 > ( ) ?) ?;
244
210
let snapshot_size: u64 = r. read_scalar :: < u64 > ( ) ?;
245
211
246
- match encoding {
247
- MetaEncoding :: MessagePack => {
248
- let snapshot: TableSnapshotMessagePack =
249
- read_and_deserialize ( & mut r, snapshot_size, & encoding, & compression) ?;
250
- Ok ( snapshot. into ( ) )
251
- }
252
- MetaEncoding :: Bincode | MetaEncoding :: Json => {
253
- let snapshot: TableSnapshot =
254
- read_and_deserialize ( & mut r, snapshot_size, & encoding, & compression) ?;
255
- Ok ( snapshot)
256
- }
257
- }
212
+ read_and_deserialize ( & mut r, snapshot_size, & encoding, & compression)
258
213
}
259
214
260
215
#[ inline]
0 commit comments