Skip to content

Commit 546c2c3

Browse files
committed
fix
Signed-off-by: coldWater <forsaken628@gmail.com>
1 parent 729a243 commit 546c2c3

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

src/query/service/src/pipelines/builders/builder_sort.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,8 @@ impl SortPipelineBuilder {
258258
Ok(ProcessorPtr::create(builder.build_collect(input, output)?))
259259
})?;
260260

261-
let state = SortSampleState::new(inputs, max_threads, self.schema.clone(), max_block_size);
261+
let state =
262+
SortSampleState::new(inputs, max_threads, builder.inner_schema(), max_block_size);
262263

263264
builder.add_shuffle(pipeline, state.clone())?;
264265

src/query/service/src/pipelines/processors/transforms/sort/sort_builder.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ impl TransformSortBuilder {
218218
}
219219

220220
fn new_base(&self) -> Base {
221-
let schema = add_order_field(self.schema.clone(), &self.sort_desc);
221+
let schema = self.inner_schema();
222222
let sort_row_offset = schema.fields().len() - 1;
223223
Base {
224224
sort_row_offset,
@@ -228,6 +228,10 @@ impl TransformSortBuilder {
228228
}
229229
}
230230

231+
pub fn inner_schema(&self) -> DataSchemaRef {
232+
add_order_field(self.schema.clone(), &self.sort_desc)
233+
}
234+
231235
pub fn add_shuffle(&self, pipeline: &mut Pipeline, state: Arc<SortSampleState>) -> Result<()> {
232236
use std::sync::atomic;
233237
let i = atomic::AtomicUsize::new(0);

src/query/service/src/pipelines/processors/transforms/sort/sort_shuffle.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,6 @@ impl SortSampleState {
251251
struct StateInner {
252252
// target partitions
253253
partitions: usize,
254-
// schema for bounds DataBlock
255254
schema: DataSchemaRef,
256255
partial: Vec<Option<Bounds>>,
257256
bounds: Option<Bounds>,

0 commit comments

Comments
 (0)