Skip to content

Commit ecb4cd7

Browse files
authored
chore: Rename CheckedAdd operator to Add (#3612)
Signed-off-by: Robert Kruszewski <[email protected]>
1 parent 3f5f3a9 commit ecb4cd7

File tree

5 files changed

+15
-15
lines changed

5 files changed

+15
-15
lines changed

vortex-expr/src/exprs/binary.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ impl AnalysisExpr for BinaryExpr {
119119
self.lhs.stat_falsification(catalog)?,
120120
self.rhs.stat_falsification(catalog)?,
121121
)),
122-
Operator::CheckedAdd => None,
122+
Operator::Add => None,
123123
}
124124
}
125125
}
@@ -142,7 +142,7 @@ impl VortexExpr for BinaryExpr {
142142
Operator::Gte => compare(&lhs, &rhs, ArrayOperator::Gte),
143143
Operator::And => and_kleene(&lhs, &rhs),
144144
Operator::Or => or_kleene(&lhs, &rhs),
145-
Operator::CheckedAdd => add(&lhs, &rhs),
145+
Operator::Add => add(&lhs, &rhs),
146146
}
147147
}
148148

@@ -159,7 +159,7 @@ impl VortexExpr for BinaryExpr {
159159
let lhs = self.lhs.return_dtype(ctx)?;
160160
let rhs = self.rhs.return_dtype(ctx)?;
161161

162-
if self.operator == Operator::CheckedAdd {
162+
if self.operator == Operator::Add {
163163
if lhs.is_primitive() && lhs.eq_ignore_nullability(&rhs) {
164164
return Ok(lhs.with_nullability(lhs.nullability() | rhs.nullability()));
165165
}
@@ -414,7 +414,7 @@ where
414414
/// );
415415
/// ```
416416
pub fn checked_add(lhs: ExprRef, rhs: ExprRef) -> ExprRef {
417-
BinaryExpr::new_expr(lhs, Operator::CheckedAdd, rhs)
417+
BinaryExpr::new_expr(lhs, Operator::Add, rhs)
418418
}
419419

420420
#[cfg(test)]

vortex-expr/src/exprs/operators.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ pub enum Operator {
2222
/// Errs at runtime if the sum would overflow or underflow.
2323
///
2424
/// The result is null at any index that either input is null.
25-
CheckedAdd,
25+
Add,
2626
}
2727

2828
#[cfg(feature = "proto")]
@@ -50,7 +50,7 @@ mod proto {
5050
Operator::Lte => BinaryOp::Lte,
5151
Operator::And => BinaryOp::And,
5252
Operator::Or => BinaryOp::Or,
53-
Operator::CheckedAdd => BinaryOp::CheckedAdd,
53+
Operator::Add => BinaryOp::Add,
5454
}
5555
}
5656
}
@@ -74,7 +74,7 @@ mod proto {
7474
BinaryOp::Lte => Operator::Lte,
7575
BinaryOp::And => Operator::And,
7676
BinaryOp::Or => Operator::Or,
77-
BinaryOp::CheckedAdd => Operator::CheckedAdd,
77+
BinaryOp::Add => Operator::Add,
7878
}
7979
}
8080
}
@@ -91,7 +91,7 @@ impl Display for Operator {
9191
Operator::Lte => "<=",
9292
Operator::And => "and",
9393
Operator::Or => "or",
94-
Operator::CheckedAdd => "+w",
94+
Operator::Add => "+w",
9595
};
9696
Display::fmt(display, f)
9797
}
@@ -106,7 +106,7 @@ impl Operator {
106106
Operator::Gte => Some(Operator::Lt),
107107
Operator::Lt => Some(Operator::Gte),
108108
Operator::Lte => Some(Operator::Gt),
109-
Operator::And | Operator::Or | Operator::CheckedAdd => None,
109+
Operator::And | Operator::Or | Operator::Add => None,
110110
}
111111
}
112112

@@ -129,7 +129,7 @@ impl Operator {
129129
Operator::Lte => Operator::Gte,
130130
Operator::And => Operator::And,
131131
Operator::Or => Operator::Or,
132-
Operator::CheckedAdd => Operator::CheckedAdd,
132+
Operator::Add => Operator::Add,
133133
}
134134
}
135135

vortex-expr/src/forms/nnf.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ impl FolderMut for NNFVisitor {
115115
Operator::Lte => Operator::Gt,
116116
Operator::And => Operator::Or,
117117
Operator::Or => Operator::And,
118-
Operator::CheckedAdd => {
118+
Operator::Add => {
119119
vortex_bail!("nnf: type mismatch: cannot negate addition")
120120
}
121121
};

vortex-proto/proto/expr.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ message Kind {
7171
Lte = 5;
7272
And = 6;
7373
Or = 7;
74-
CheckedAdd = 8;
74+
Add = 8;
7575
}
7676

7777
message Between {

vortex-proto/src/generated/vortex.expr.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ pub mod kind {
8989
Lte = 5,
9090
And = 6,
9191
Or = 7,
92-
CheckedAdd = 8,
92+
Add = 8,
9393
}
9494
impl BinaryOp {
9595
/// String value of the enum field names used in the ProtoBuf definition.
@@ -106,7 +106,7 @@ pub mod kind {
106106
Self::Lte => "Lte",
107107
Self::And => "And",
108108
Self::Or => "Or",
109-
Self::CheckedAdd => "CheckedAdd",
109+
Self::Add => "Add",
110110
}
111111
}
112112
/// Creates an enum from field names used in the ProtoBuf definition.
@@ -120,7 +120,7 @@ pub mod kind {
120120
"Lte" => Some(Self::Lte),
121121
"And" => Some(Self::And),
122122
"Or" => Some(Self::Or),
123-
"CheckedAdd" => Some(Self::CheckedAdd),
123+
"Add" => Some(Self::Add),
124124
_ => None,
125125
}
126126
}

0 commit comments

Comments
 (0)