Skip to content

Commit 6fd8821

Browse files
chore: replace all ProstXxx with PbXxx (risingwavelabs#8621)
Signed-off-by: Runji Wang <[email protected]>
1 parent d90165a commit 6fd8821

File tree

175 files changed

+994
-1065
lines changed

Some content is hidden

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

175 files changed

+994
-1065
lines changed

src/batch/benches/filter.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ use risingwave_common::types::{DataType, ScalarImpl};
2121
use risingwave_common::util::value_encoding::serialize_datum;
2222
use risingwave_expr::expr::build_from_prost;
2323
use risingwave_pb::data::data_type::TypeName;
24-
use risingwave_pb::data::Datum as ProstDatum;
24+
use risingwave_pb::data::PbDatum;
2525
use risingwave_pb::expr::expr_node::RexNode;
2626
use risingwave_pb::expr::expr_node::Type::{
2727
ConstantValue as TConstValue, Equal, InputRef, Modulus,
@@ -53,7 +53,7 @@ fn create_filter_executor(chunk_size: usize, chunk_num: usize) -> BoxedExecutor
5353
type_name: TypeName::Int64 as i32,
5454
..Default::default()
5555
}),
56-
rex_node: Some(RexNode::Constant(ProstDatum {
56+
rex_node: Some(RexNode::Constant(PbDatum {
5757
body: serialize_datum(Some(ScalarImpl::Int64(2)).as_ref()),
5858
})),
5959
};
@@ -76,7 +76,7 @@ fn create_filter_executor(chunk_size: usize, chunk_num: usize) -> BoxedExecutor
7676
type_name: TypeName::Int64 as i32,
7777
..Default::default()
7878
}),
79-
rex_node: Some(RexNode::Constant(ProstDatum {
79+
rex_node: Some(RexNode::Constant(PbDatum {
8080
body: serialize_datum(Some(ScalarImpl::Int64(0)).as_ref()),
8181
})),
8282
};

src/batch/benches/hash_join.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ use risingwave_common::util::value_encoding::serialize_datum;
2424
use risingwave_common::{enable_jemalloc_on_linux, hash};
2525
use risingwave_expr::expr::build_from_prost;
2626
use risingwave_pb::data::data_type::TypeName;
27-
use risingwave_pb::data::Datum as ProstDatum;
27+
use risingwave_pb::data::PbDatum;
2828
use risingwave_pb::expr::expr_node::RexNode;
2929
use risingwave_pb::expr::expr_node::Type::{
3030
ConstantValue as TConstValue, GreaterThan, InputRef, Modulus,
@@ -58,7 +58,7 @@ fn create_hash_join_executor(
5858
type_name: TypeName::Int64 as i32,
5959
..Default::default()
6060
}),
61-
rex_node: Some(RexNode::Constant(ProstDatum {
61+
rex_node: Some(RexNode::Constant(PbDatum {
6262
body: serialize_datum(Some(ScalarImpl::Int64(123)).as_ref()),
6363
})),
6464
};
@@ -88,7 +88,7 @@ fn create_hash_join_executor(
8888
type_name: TypeName::Int64 as i32,
8989
..Default::default()
9090
}),
91-
rex_node: Some(RexNode::Constant(ProstDatum {
91+
rex_node: Some(RexNode::Constant(PbDatum {
9292
body: serialize_datum(Some(ScalarImpl::Int64(456)).as_ref()),
9393
})),
9494
};
@@ -141,7 +141,7 @@ fn create_hash_join_executor(
141141
type_name: TypeName::Int64 as i32,
142142
..Default::default()
143143
}),
144-
rex_node: Some(RexNode::Constant(ProstDatum {
144+
rex_node: Some(RexNode::Constant(PbDatum {
145145
body: serialize_datum(Some(ScalarImpl::Int64(100)).as_ref()),
146146
})),
147147
};

src/batch/benches/nested_loop_join.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ use risingwave_common::types::{DataType, ScalarImpl};
2020
use risingwave_common::util::value_encoding::serialize_datum;
2121
use risingwave_expr::expr::build_from_prost;
2222
use risingwave_pb::data::data_type::TypeName;
23-
use risingwave_pb::data::Datum as ProstDatum;
23+
use risingwave_pb::data::PbDatum;
2424
use risingwave_pb::expr::expr_node::RexNode;
2525
use risingwave_pb::expr::expr_node::Type::{
2626
ConstantValue as TConstValue, Equal, InputRef, Modulus,
@@ -68,7 +68,7 @@ fn create_nested_loop_join_executor(
6868
type_name: TypeName::Int64 as i32,
6969
..Default::default()
7070
}),
71-
rex_node: Some(RexNode::Constant(ProstDatum {
71+
rex_node: Some(RexNode::Constant(PbDatum {
7272
body: serialize_datum(Some(ScalarImpl::Int64(2)).as_ref()),
7373
})),
7474
};
@@ -79,7 +79,7 @@ fn create_nested_loop_join_executor(
7979
type_name: TypeName::Int64 as i32,
8080
..Default::default()
8181
}),
82-
rex_node: Some(RexNode::Constant(ProstDatum {
82+
rex_node: Some(RexNode::Constant(PbDatum {
8383
body: serialize_datum(Some(ScalarImpl::Int64(3)).as_ref()),
8484
})),
8585
};

src/batch/src/executor/filter.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ mod tests {
131131
use risingwave_common::util::value_encoding::serialize_datum;
132132
use risingwave_expr::expr::build_from_prost;
133133
use risingwave_pb::data::data_type::TypeName;
134-
use risingwave_pb::data::Datum as ProstDatum;
134+
use risingwave_pb::data::PbDatum;
135135
use risingwave_pb::expr::expr_node::Type::InputRef;
136136
use risingwave_pb::expr::expr_node::{RexNode, Type};
137137
use risingwave_pb::expr::{ExprNode, FunctionCall};
@@ -242,7 +242,7 @@ mod tests {
242242
}],
243243
..Default::default()
244244
}),
245-
rex_node: Some(RexNode::Constant(ProstDatum {
245+
rex_node: Some(RexNode::Constant(PbDatum {
246246
body: serialize_datum(
247247
Some(ScalarImpl::List(ListValue::new(vec![Some(
248248
2.to_scalar_value(),

src/batch/src/executor/generic_exchange.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ use risingwave_common::error::{Result, RwError};
2121
use risingwave_common::util::iter_util::ZipEqFast;
2222
use risingwave_common::util::select_all;
2323
use risingwave_pb::batch_plan::plan_node::NodeBody;
24-
use risingwave_pb::batch_plan::ExchangeSource as ProstExchangeSource;
24+
use risingwave_pb::batch_plan::PbExchangeSource;
2525
use risingwave_pb::plan_common::Field as NodeField;
2626
use risingwave_rpc_client::ComputeClientPoolRef;
2727

@@ -36,7 +36,7 @@ use super::BatchTaskMetricsWithTaskLabels;
3636
use crate::executor::{BoxedDataChunkStream, BoxedExecutor, BoxedExecutorBuilder, Executor};
3737

3838
pub struct GenericExchangeExecutor<CS, C> {
39-
proto_sources: Vec<ProstExchangeSource>,
39+
proto_sources: Vec<PbExchangeSource>,
4040
/// Mock-able CreateSource.
4141
source_creators: Vec<CS>,
4242
context: C,
@@ -56,7 +56,7 @@ pub trait CreateSource: Send {
5656
async fn create_source(
5757
&self,
5858
context: impl BatchTaskContext,
59-
prost_source: &ProstExchangeSource,
59+
prost_source: &PbExchangeSource,
6060
) -> Result<ExchangeSourceImpl>;
6161
}
6262

@@ -76,7 +76,7 @@ impl CreateSource for DefaultCreateSource {
7676
async fn create_source(
7777
&self,
7878
context: impl BatchTaskContext,
79-
prost_source: &ProstExchangeSource,
79+
prost_source: &PbExchangeSource,
8080
) -> Result<ExchangeSourceImpl> {
8181
let peer_addr = prost_source.get_host()?.into();
8282
let task_output_id = prost_source.get_task_output_id()?;
@@ -127,7 +127,7 @@ impl BoxedExecutorBuilder for GenericExchangeExecutorBuilder {
127127
)?;
128128

129129
ensure!(!node.get_sources().is_empty());
130-
let proto_sources: Vec<ProstExchangeSource> = node.get_sources().to_vec();
130+
let proto_sources: Vec<PbExchangeSource> = node.get_sources().to_vec();
131131
let source_creators =
132132
vec![DefaultCreateSource::new(source.context().client_pool()); proto_sources.len()];
133133

@@ -189,7 +189,7 @@ impl<CS: 'static + Send + CreateSource, C: BatchTaskContext> GenericExchangeExec
189189

190190
#[try_stream(boxed, ok = DataChunk, error = RwError)]
191191
async fn data_chunk_stream(
192-
prost_source: ProstExchangeSource,
192+
prost_source: PbExchangeSource,
193193
source_creator: CS,
194194
context: C,
195195
metrics: Option<BatchTaskMetricsWithTaskLabels>,
@@ -264,7 +264,7 @@ mod tests {
264264
let chunks = vec![Some(chunk); 100];
265265
let fake_exchange_source = FakeExchangeSource::new(chunks);
266266
let fake_create_source = FakeCreateSource::new(fake_exchange_source);
267-
proto_sources.push(ProstExchangeSource::default());
267+
proto_sources.push(PbExchangeSource::default());
268268
source_creators.push(fake_create_source);
269269
}
270270

src/batch/src/executor/hash_agg.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ mod tests {
270270
use risingwave_common::catalog::{Field, Schema};
271271
use risingwave_common::test_prelude::DataChunkTestExt;
272272
use risingwave_pb::data::data_type::TypeName;
273-
use risingwave_pb::data::DataType as ProstDataType;
273+
use risingwave_pb::data::PbDataType;
274274
use risingwave_pb::expr::agg_call::Type;
275275
use risingwave_pb::expr::{AggCall, InputRef};
276276

@@ -309,12 +309,12 @@ mod tests {
309309
r#type: Type::Sum as i32,
310310
args: vec![InputRef {
311311
index: 2,
312-
r#type: Some(ProstDataType {
312+
r#type: Some(PbDataType {
313313
type_name: TypeName::Int32 as i32,
314314
..Default::default()
315315
}),
316316
}],
317-
return_type: Some(ProstDataType {
317+
return_type: Some(PbDataType {
318318
type_name: TypeName::Int64 as i32,
319319
..Default::default()
320320
}),
@@ -382,7 +382,7 @@ mod tests {
382382
let agg_call = AggCall {
383383
r#type: Type::Count as i32,
384384
args: vec![],
385-
return_type: Some(ProstDataType {
385+
return_type: Some(PbDataType {
386386
type_name: TypeName::Int64 as i32,
387387
..Default::default()
388388
}),

src/batch/src/executor/join/local_lookup_join.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ use risingwave_pb::batch_plan::exchange_info::DistributionMode;
3232
use risingwave_pb::batch_plan::exchange_source::LocalExecutePlan::Plan;
3333
use risingwave_pb::batch_plan::plan_node::NodeBody;
3434
use risingwave_pb::batch_plan::{
35-
ExchangeInfo, ExchangeNode, ExchangeSource as ProstExchangeSource, LocalExecutePlan,
36-
PlanFragment, PlanNode, RowSeqScanNode, TaskId as ProstTaskId, TaskOutputId,
35+
ExchangeInfo, ExchangeNode, LocalExecutePlan, PbExchangeSource, PbTaskId, PlanFragment,
36+
PlanNode, RowSeqScanNode, TaskOutputId,
3737
};
3838
use risingwave_pb::common::{BatchQueryEpoch, WorkerNode};
3939
use risingwave_pb::plan_common::StorageTableDesc;
@@ -113,8 +113,8 @@ impl<C: BatchTaskContext> InnerSideExecutorBuilder<C> {
113113
Ok(row_seq_scan_node)
114114
}
115115

116-
/// Creates the `ProstExchangeSource` using the given `id`.
117-
fn build_prost_exchange_source(&self, id: &ParallelUnitId) -> Result<ProstExchangeSource> {
116+
/// Creates the `PbExchangeSource` using the given `id`.
117+
fn build_prost_exchange_source(&self, id: &ParallelUnitId) -> Result<PbExchangeSource> {
118118
let worker = self.pu_to_worker_mapping.get(id).ok_or_else(|| {
119119
internal_error("No worker node found for the given parallel unit id.")
120120
})?;
@@ -134,9 +134,9 @@ impl<C: BatchTaskContext> InnerSideExecutorBuilder<C> {
134134
epoch: Some(self.epoch.clone()),
135135
};
136136

137-
let prost_exchange_source = ProstExchangeSource {
137+
let prost_exchange_source = PbExchangeSource {
138138
task_output_id: Some(TaskOutputId {
139-
task_id: Some(ProstTaskId {
139+
task_id: Some(PbTaskId {
140140
// FIXME: We should replace this random generated uuid to current query_id for
141141
// better dashboard. However, due to the lack of info of
142142
// stage_id and task_id, we can not do it now. Now just make sure it will not

src/batch/src/executor/join/mod.rs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ use risingwave_common::error::Result;
3131
use risingwave_common::row::Row;
3232
use risingwave_common::types::{DataType, DatumRef};
3333
use risingwave_common::util::iter_util::ZipEqFast;
34-
use risingwave_pb::plan_common::JoinType as JoinTypeProst;
34+
use risingwave_pb::plan_common::JoinType as JoinTypePb;
3535

3636
use crate::error::BatchError;
3737

@@ -61,17 +61,17 @@ impl JoinType {
6161
)
6262
}
6363

64-
pub fn from_prost(prost: JoinTypeProst) -> Self {
64+
pub fn from_prost(prost: JoinTypePb) -> Self {
6565
match prost {
66-
JoinTypeProst::Inner => JoinType::Inner,
67-
JoinTypeProst::LeftOuter => JoinType::LeftOuter,
68-
JoinTypeProst::LeftSemi => JoinType::LeftSemi,
69-
JoinTypeProst::LeftAnti => JoinType::LeftAnti,
70-
JoinTypeProst::RightOuter => JoinType::RightOuter,
71-
JoinTypeProst::RightSemi => JoinType::RightSemi,
72-
JoinTypeProst::RightAnti => JoinType::RightAnti,
73-
JoinTypeProst::FullOuter => JoinType::FullOuter,
74-
JoinTypeProst::Unspecified => unreachable!(),
66+
JoinTypePb::Inner => JoinType::Inner,
67+
JoinTypePb::LeftOuter => JoinType::LeftOuter,
68+
JoinTypePb::LeftSemi => JoinType::LeftSemi,
69+
JoinTypePb::LeftAnti => JoinType::LeftAnti,
70+
JoinTypePb::RightOuter => JoinType::RightOuter,
71+
JoinTypePb::RightSemi => JoinType::RightSemi,
72+
JoinTypePb::RightAnti => JoinType::RightAnti,
73+
JoinTypePb::FullOuter => JoinType::FullOuter,
74+
JoinTypePb::Unspecified => unreachable!(),
7575
}
7676
}
7777

src/batch/src/executor/merge_sort_exchange.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ use risingwave_common::error::{Result, RwError};
2222
use risingwave_common::types::ToOwnedDatum;
2323
use risingwave_common::util::sort_util::{ColumnOrder, HeapElem};
2424
use risingwave_pb::batch_plan::plan_node::NodeBody;
25-
use risingwave_pb::batch_plan::ExchangeSource as ProstExchangeSource;
25+
use risingwave_pb::batch_plan::PbExchangeSource;
2626

2727
use crate::exchange_source::ExchangeSourceImpl;
2828
use crate::executor::{
@@ -41,7 +41,7 @@ pub struct MergeSortExchangeExecutorImpl<CS, C> {
4141
source_inputs: Vec<Option<DataChunk>>,
4242
column_orders: Arc<Vec<ColumnOrder>>,
4343
min_heap: BinaryHeap<HeapElem>,
44-
proto_sources: Vec<ProstExchangeSource>,
44+
proto_sources: Vec<PbExchangeSource>,
4545
sources: Vec<ExchangeSourceImpl>, // impl
4646
/// Mock-able CreateSource.
4747
source_creators: Vec<CS>,
@@ -199,7 +199,7 @@ impl BoxedExecutorBuilder for MergeSortExchangeExecutorBuilder {
199199
let column_orders = Arc::new(column_orders);
200200

201201
let exchange_node = sort_merge_node.get_exchange()?;
202-
let proto_sources: Vec<ProstExchangeSource> = exchange_node.get_sources().to_vec();
202+
let proto_sources: Vec<PbExchangeSource> = exchange_node.get_sources().to_vec();
203203
let source_creators =
204204
vec![DefaultCreateSource::new(source.context().client_pool()); proto_sources.len()];
205205
ensure!(!exchange_node.get_sources().is_empty());
@@ -253,11 +253,11 @@ mod tests {
253253
let fake_exchange_source = FakeExchangeSource::new(vec![Some(chunk)]);
254254
let fake_create_source = FakeCreateSource::new(fake_exchange_source);
255255

256-
let mut proto_sources: Vec<ProstExchangeSource> = vec![];
256+
let mut proto_sources: Vec<PbExchangeSource> = vec![];
257257
let mut source_creators = vec![];
258258
let num_sources = 2;
259259
for _ in 0..num_sources {
260-
proto_sources.push(ProstExchangeSource::default());
260+
proto_sources.push(PbExchangeSource::default());
261261
source_creators.push(fake_create_source.clone());
262262
}
263263
let column_orders = Arc::new(vec![ColumnOrder {

src/batch/src/executor/row_seq_scan.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ use risingwave_common::util::select_all;
2929
use risingwave_common::util::sort_util::{Direction, OrderType};
3030
use risingwave_common::util::value_encoding::deserialize_datum;
3131
use risingwave_pb::batch_plan::plan_node::NodeBody;
32-
use risingwave_pb::batch_plan::{scan_range, ScanRange as ProstScanRange};
32+
use risingwave_pb::batch_plan::{scan_range, PbScanRange};
3333
use risingwave_pb::common::BatchQueryEpoch;
3434
use risingwave_pb::plan_common::StorageTableDesc;
3535
use risingwave_storage::store::PrefetchOptions;
@@ -75,7 +75,7 @@ impl ScanRange {
7575

7676
/// Create a scan range from the prost representation.
7777
pub fn new(
78-
scan_range: ProstScanRange,
78+
scan_range: PbScanRange,
7979
mut pk_types: impl Iterator<Item = DataType>,
8080
) -> Result<Self> {
8181
let pk_prefix = OwnedRow::new(

0 commit comments

Comments
 (0)