diff --git a/proto/batch_plan.proto b/proto/batch_plan.proto index 7b5fe06b4d563..9e409f057807a 100644 --- a/proto/batch_plan.proto +++ b/proto/batch_plan.proto @@ -30,11 +30,8 @@ message RowSeqScanNode { } // If along with `batch_limit`, `chunk_size` will be set. ChunkSize chunk_size = 6; - message Limit { - uint64 limit = 1; - } // The pushed down `batch_limit`. Max rows needed to return. - Limit limit = 7; + optional uint64 limit = 7; } message SysRowSeqScanNode { diff --git a/src/batch/src/executor/row_seq_scan.rs b/src/batch/src/executor/row_seq_scan.rs index 8cd32688936bd..f45342d4d1363 100644 --- a/src/batch/src/executor/row_seq_scan.rs +++ b/src/batch/src/executor/row_seq_scan.rs @@ -255,7 +255,7 @@ impl BoxedExecutorBuilder for RowSeqScanExecutorBuilder { } else { source.context.get_config().developer.chunk_size as u32 }; - let limit = seq_scan_node.limit.clone().map(|limit| limit.limit); + let limit = seq_scan_node.limit; let metrics = source.context().batch_metrics(); dispatch_state_store!(source.context().state_store(), state_store, { diff --git a/src/frontend/src/optimizer/plan_node/batch_seq_scan.rs b/src/frontend/src/optimizer/plan_node/batch_seq_scan.rs index 3dd5b4fc6c2e3..e43673350fb43 100644 --- a/src/frontend/src/optimizer/plan_node/batch_seq_scan.rs +++ b/src/frontend/src/optimizer/plan_node/batch_seq_scan.rs @@ -20,7 +20,7 @@ use risingwave_common::error::Result; use risingwave_common::types::ScalarImpl; use risingwave_common::util::scan_range::{is_full_range, ScanRange}; use risingwave_pb::batch_plan::plan_node::NodeBody; -use risingwave_pb::batch_plan::row_seq_scan_node::{ChunkSize, Limit}; +use risingwave_pb::batch_plan::row_seq_scan_node::ChunkSize; use risingwave_pb::batch_plan::RowSeqScanNode; use super::batch::prelude::*; @@ -251,7 +251,7 @@ impl ToBatchPb for BatchSeqScan { .core .chunk_size .map(|chunk_size| ChunkSize { chunk_size }), - limit: self.limit().map(|limit| Limit { limit }), + limit: *self.limit(), }) } }