Skip to content

Commit

Permalink
fix proto field name compatibility
Browse files Browse the repository at this point in the history
Signed-off-by: Richard Chien <[email protected]>
  • Loading branch information
stdrc committed Sep 24, 2024
1 parent 32637bf commit 9b244c6
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions proto/expr.proto
Original file line number Diff line number Diff line change
Expand Up @@ -576,8 +576,8 @@ message WindowFunction {

oneof type {
GeneralType general = 1;
AggCall.Kind aggregate_simple = 2 [deprecated = true]; // Deprecated since we have a new `aggregate` variant.
AggType aggregate = 103;
AggCall.Kind aggregate = 2 [deprecated = true]; // Deprecated since we have a new `aggregate` variant.
AggType aggregate2 = 103;
}
repeated InputRef args = 3;
data.DataType return_type = 4;
Expand Down
4 changes: 2 additions & 2 deletions src/expr/core/src/window_function/kind.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,12 @@ impl WindowFuncKind {
Ok(PbGeneralType::Lead) => Self::Lead,
Err(_) => bail!("no such window function type"),
},
PbType::AggregateSimple(kind) => Self::Aggregate(AggType::from_protobuf_flatten(
PbType::Aggregate(kind) => Self::Aggregate(AggType::from_protobuf_flatten(
PbAggKind::try_from(*kind).context("no such aggregate function type")?,
None,
None,
)?),
PbType::Aggregate(agg_type) => Self::Aggregate(AggType::from_protobuf(agg_type)?),
PbType::Aggregate2(agg_type) => Self::Aggregate(AggType::from_protobuf(agg_type)?),
};
Ok(kind)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ impl PlanWindowFunction {
DenseRank => PbType::General(PbGeneralType::DenseRank as _),
Lag => PbType::General(PbGeneralType::Lag as _),
Lead => PbType::General(PbGeneralType::Lead as _),
Aggregate(agg_type) => PbType::Aggregate(agg_type.to_protobuf()),
Aggregate(agg_type) => PbType::Aggregate2(agg_type.to_protobuf()),
};

PbWindowFunction {
Expand Down

0 comments on commit 9b244c6

Please sign in to comment.