New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

coprocessor, dag: support decode Time from tipb.Expr #2199

Merged
merged 43 commits into from Aug 28, 2017
Commits
Jump to file or symbol
Failed to load files and symbols.
+37 −5
Diff settings

Always

Just for now

Viewing a subset of changes. View all

Merge branch 'master' into qupeng/expr-math

  • Loading branch information...
hicqu committed Aug 22, 2017
commit 7129177edb79e95fb9058251f61213629933e853
@@ -74,15 +74,31 @@ impl FnCall {
ScalarFuncSig::MinusInt |
ScalarFuncSig::MultiplyReal |
ScalarFuncSig::MultiplyDecimal |
ScalarFuncSig::MultiplyInt => (2, 2),
ScalarFuncSig::MultiplyInt |
ScalarFuncSig::LogicalAnd |
ScalarFuncSig::LogicalOr |
ScalarFuncSig::LogicalXor |
ScalarFuncSig::LTInt => (2, 2),
ScalarFuncSig::CastIntAsInt |
ScalarFuncSig::CastIntAsReal |
ScalarFuncSig::CastIntAsString |
ScalarFuncSig::CastIntAsDecimal |
ScalarFuncSig::CastIntAsTime |
ScalarFuncSig::CastIntAsDuration |
ScalarFuncSig::CastIntAsJson => (1, 1),
ScalarFuncSig::CastIntAsJson |
ScalarFuncSig::UnaryNot |
ScalarFuncSig::IntIsFalse |
ScalarFuncSig::IntIsNull |
ScalarFuncSig::RealIsTrue |
ScalarFuncSig::RealIsNull |
ScalarFuncSig::DecimalIsTrue |
ScalarFuncSig::DecimalIsNull |
ScalarFuncSig::StringIsNull |
ScalarFuncSig::TimeIsNull |
ScalarFuncSig::DurationIsNull |
ScalarFuncSig::CastIntAsInt => (1, 1),
_ => unimplemented!(),
};
if args < min_args || args > max_args {
Copy path View file
@@ -212,6 +212,20 @@ impl Expression {
ScalarFuncSig::PlusInt => f.plus_int(ctx, row),
ScalarFuncSig::MinusInt => f.minus_int(ctx, row),
ScalarFuncSig::MultiplyInt => f.multiply_int(ctx, row),
ScalarFuncSig::LogicalAnd => f.logical_and(ctx, row),
ScalarFuncSig::LogicalOr => f.logical_or(ctx, row),
ScalarFuncSig::LogicalXor => f.logical_xor(ctx, row),
ScalarFuncSig::UnaryNot => f.unary_not(ctx, row),
ScalarFuncSig::IntIsNull => f.int_is_null(ctx, row),
ScalarFuncSig::IntIsFalse => f.int_is_false(ctx, row),
ScalarFuncSig::RealIsTrue => f.real_is_true(ctx, row),
ScalarFuncSig::RealIsNull => f.real_is_null(ctx, row),
ScalarFuncSig::DecimalIsNull => f.decimal_is_null(ctx, row),
ScalarFuncSig::DecimalIsTrue => f.decimal_is_true(ctx, row),
ScalarFuncSig::StringIsNull => f.string_is_null(ctx, row),
ScalarFuncSig::TimeIsNull => f.time_is_null(ctx, row),
ScalarFuncSig::DurationIsNull => f.duration_is_null(ctx, row),
_ => Err(Error::Other("Unknown signature")),
},
@@ -226,7 +240,8 @@ impl Expression {
ScalarFuncSig::PlusReal => f.plus_real(ctx, row),
ScalarFuncSig::MinusReal => f.minus_real(ctx, row),
ScalarFuncSig::MultiplyReal => f.multiply_real(ctx, row),
_ => unimplemented!(),
_ => Err(Error::Other("Unknown signature")),
},
}
}
@@ -243,7 +258,8 @@ impl Expression {
ScalarFuncSig::PlusDecimal => f.plus_decimal(ctx, row),
ScalarFuncSig::MinusDecimal => f.minus_decimal(ctx, row),
ScalarFuncSig::MultiplyDecimal => f.multiply_decimal(ctx, row),
_ => unimplemented!(),
_ => Err(Error::Other("Unknown signature")),
},
}
}
@@ -397,7 +413,7 @@ mod test {
#[inline]
pub fn str2dec(s: &str) -> Datum {
Datum::Dec(s.parse::<Decimal>().unwrap())
Datum::Dec(s.parse().unwrap())
}
pub fn fncall_expr(sig: ScalarFuncSig, children: &[Expr]) -> Expr {
You are viewing a condensed version of this merge commit. You can view the full changes here.
ProTip! Use n and p to navigate between commits in a pull request.