Skip to content

Commit fe00398

Browse files
committed
fix(fuse): isolate partition and cluster layouts
1 parent 91809b4 commit fe00398

41 files changed

Lines changed: 708 additions & 287 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

src/query/service/src/physical_plans/physical_commit_sink.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ impl IPhysicalPlan for CommitSink {
149149
}
150150
CommitType::Mutation { kind, merge_meta } => {
151151
if *merge_meta {
152-
let cluster_key_id = table.physical_cluster_key_id();
152+
let cluster_key_id = table.cluster_key_id();
153153
builder.main_pipeline.add_accumulating_transformer(|| {
154154
TransformMergeCommitMeta::create(cluster_key_id)
155155
});

src/query/service/src/physical_plans/physical_compact_source.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ impl IPhysicalPlan for CompactSource {
9797

9898
let is_lazy = self.parts.partitions_type() == PartInfoType::LazyLevel;
9999
let thresholds = table.get_block_thresholds();
100-
let cluster_key_id = table.physical_cluster_key_id();
100+
let cluster_key_id = table.cluster_key_id();
101101
let partition_key_count = table.partition_key_count();
102102
let mut max_threads = builder.settings.get_max_threads()? as usize;
103103

src/query/service/src/physical_plans/physical_multi_table_insert.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -762,7 +762,7 @@ impl IPhysicalPlan for ChunkAppendData {
762762
sort_builders.push(Box::new(builder.dummy_transform_builder()));
763763
}
764764
let partition_key_indices: Arc<[_]> =
765-
cluster_stats_gen.cluster_key_index[..cluster_stats_gen.partition_key_count].into();
765+
cluster_stats_gen.partition_key_index.clone().into();
766766
if !partition_key_indices.is_empty() {
767767
partition_builders.push(Box::new(move |input, output| {
768768
Ok(ProcessorPtr::create(AccumulatingTransformer::create(

src/query/service/src/test_kits/fuse.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ pub async fn generate_segments_v2(
119119
TestFixture::default_table_meta_timestamps(),
120120
)
121121
.await?;
122-
let mut summary = reduce_block_metas(&block_metas, BlockThresholds::default(), None);
122+
let mut summary = reduce_block_metas(&block_metas, BlockThresholds::default(), None)?;
123123
let uuid = Uuid::new_v4();
124124
let location = format!(
125125
"{}/{}/{}_v{}.json",
@@ -162,7 +162,7 @@ pub async fn generate_segments(
162162
table_meta_timestamps,
163163
)
164164
.await?;
165-
let mut summary = reduce_block_metas(&block_metas, BlockThresholds::default(), None);
165+
let mut summary = reduce_block_metas(&block_metas, BlockThresholds::default(), None)?;
166166
let location = if is_greater_than_v5 {
167167
location_generator.gen_segment_info_location(table_meta_timestamps, false)
168168
} else {

src/query/service/tests/it/storages/fuse/bloom_index_meta_size.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,7 @@ fn build_test_segment_info(
331331
col_stats: col_stats.clone(),
332332
col_metas,
333333
cluster_stats: None,
334+
partition_stats: None,
334335
location: block_location,
335336
bloom_filter_index_location: Some(location_gen.block_bloom_index_location(&block_uuid)),
336337
bloom_filter_index_size: 0,
@@ -368,6 +369,7 @@ fn build_test_segment_info(
368369
virtual_col_stats: None,
369370
spatial_stats: None,
370371
cluster_stats: None,
372+
partition_stats: None,
371373
virtual_block_count: None,
372374
additional_stats_meta: None,
373375
};

src/query/service/tests/it/storages/fuse/conflict.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ fn test_resolvable_delete_conflict() {
105105
virtual_col_stats: None,
106106
spatial_stats: None,
107107
cluster_stats: None,
108+
partition_stats: None,
108109
virtual_block_count: None,
109110
additional_stats_meta: None,
110111
};
@@ -133,6 +134,7 @@ fn test_resolvable_delete_conflict() {
133134
virtual_col_stats: None,
134135
spatial_stats: None,
135136
cluster_stats: None,
137+
partition_stats: None,
136138
virtual_block_count: None,
137139
additional_stats_meta: None,
138140
};
@@ -154,6 +156,7 @@ fn test_resolvable_delete_conflict() {
154156
virtual_col_stats: None,
155157
spatial_stats: None,
156158
cluster_stats: None,
159+
partition_stats: None,
157160
virtual_block_count: None,
158161
additional_stats_meta: None,
159162
};
@@ -175,6 +178,7 @@ fn test_resolvable_delete_conflict() {
175178
virtual_col_stats: None,
176179
spatial_stats: None,
177180
cluster_stats: None,
181+
partition_stats: None,
178182
virtual_block_count: None,
179183
additional_stats_meta: None,
180184
};
@@ -219,6 +223,7 @@ fn test_resolvable_delete_conflict() {
219223
virtual_col_stats: None,
220224
spatial_stats: None,
221225
cluster_stats: None,
226+
partition_stats: None,
222227
virtual_block_count: None,
223228
additional_stats_meta: None,
224229
};
@@ -260,6 +265,7 @@ fn test_resolvable_replace_conflict() {
260265
virtual_col_stats: None,
261266
spatial_stats: None,
262267
cluster_stats: None,
268+
partition_stats: None,
263269
virtual_block_count: None,
264270
additional_stats_meta: None,
265271
};
@@ -288,6 +294,7 @@ fn test_resolvable_replace_conflict() {
288294
virtual_col_stats: None,
289295
spatial_stats: None,
290296
cluster_stats: None,
297+
partition_stats: None,
291298
virtual_block_count: None,
292299
additional_stats_meta: None,
293300
};
@@ -309,6 +316,7 @@ fn test_resolvable_replace_conflict() {
309316
virtual_col_stats: None,
310317
spatial_stats: None,
311318
cluster_stats: None,
319+
partition_stats: None,
312320
virtual_block_count: None,
313321
additional_stats_meta: None,
314322
};
@@ -330,6 +338,7 @@ fn test_resolvable_replace_conflict() {
330338
virtual_col_stats: None,
331339
spatial_stats: None,
332340
cluster_stats: None,
341+
partition_stats: None,
333342
virtual_block_count: None,
334343
additional_stats_meta: None,
335344
};
@@ -379,6 +388,7 @@ fn test_resolvable_replace_conflict() {
379388
virtual_col_stats: None,
380389
spatial_stats: None,
381390
cluster_stats: None,
391+
partition_stats: None,
382392
virtual_block_count: None,
383393
additional_stats_meta: None,
384394
};

src/query/service/tests/it/storages/fuse/meta/column_oriented.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ fn check_block_level_meta(
311311
}
312312

313313
fn check_summary(block_metas: &[BlockMeta], column_oriented_segment: &ColumnOrientedSegment) {
314-
let summary = reduce_block_metas(block_metas, Default::default(), Some(0));
314+
let summary = reduce_block_metas(block_metas, Default::default(), Some(0)).unwrap();
315315
assert_eq!(summary.row_count, column_oriented_segment.summary.row_count);
316316
assert_eq!(
317317
summary.block_count,

0 commit comments

Comments
 (0)