Skip to content

Commit cb87843

Browse files
committed
workaround for optional in proto
Signed-off-by: Eurekaaw <[email protected]>
1 parent fc94781 commit cb87843

File tree

4 files changed

+51
-13
lines changed

4 files changed

+51
-13
lines changed

dashboard/proto/gen/batch_plan.ts

Lines changed: 33 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

proto/batch_plan.proto

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,10 @@ message RowSeqScanNode {
2525
// Whether the order on output columns should be preserved.
2626
bool ordered = 5;
2727

28-
optional uint32 chunk_size = 6;
28+
message ChunkSize {
29+
uint32 chunk_size = 1;
30+
}
31+
ChunkSize chunk_size = 6;
2932
}
3033

3134
message SysRowSeqScanNode {

src/batch/src/executor/row_seq_scan.rs

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -241,12 +241,13 @@ impl BoxedExecutorBuilder for RowSeqScanExecutorBuilder {
241241
let ordered = seq_scan_node.ordered;
242242

243243
let epoch = source.epoch.clone();
244-
let chunk_size = source.context.get_config().developer.batch_chunk_size.min(
245-
seq_scan_node
246-
.chunk_size
247-
.unwrap_or(source.context.get_config().developer.batch_chunk_size as u32)
248-
as usize,
249-
);
244+
let chunk_size = if let Some(chunk_size_) = &seq_scan_node.chunk_size {
245+
chunk_size_
246+
.get_chunk_size()
247+
.min(source.context.get_config().developer.batch_chunk_size as u32)
248+
} else {
249+
source.context.get_config().developer.batch_chunk_size as u32
250+
};
250251
let metrics = source.context().task_metrics();
251252

252253
dispatch_state_store!(source.context().state_store(), state_store, {
@@ -267,7 +268,7 @@ impl BoxedExecutorBuilder for RowSeqScanExecutorBuilder {
267268
scan_ranges,
268269
ordered,
269270
epoch,
270-
chunk_size,
271+
chunk_size as usize,
271272
source.plan_node().get_identity().clone(),
272273
metrics,
273274
)))

src/frontend/src/optimizer/plan_node/batch_seq_scan.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ use risingwave_common::error::Result;
2020
use risingwave_common::types::ScalarImpl;
2121
use risingwave_common::util::scan_range::{is_full_range, ScanRange};
2222
use risingwave_pb::batch_plan::plan_node::NodeBody;
23+
use risingwave_pb::batch_plan::row_seq_scan_node::ChunkSize;
2324
use risingwave_pb::batch_plan::{RowSeqScanNode, SysRowSeqScanNode};
2425
use risingwave_pb::plan_common::ColumnDesc as ProstColumnDesc;
2526

@@ -240,7 +241,11 @@ impl ToBatchProst for BatchSeqScan {
240241
// To be filled by the scheduler.
241242
vnode_bitmap: None,
242243
ordered: !self.order().is_any(),
243-
chunk_size: self.logical.chunk_size(),
244+
chunk_size: if let Some(chunk_size) = self.logical.chunk_size() {
245+
Some(ChunkSize { chunk_size })
246+
} else {
247+
None
248+
},
244249
})
245250
}
246251
}

0 commit comments

Comments
 (0)