Skip to content

Commit

Permalink
Update with new parse interface
Browse files Browse the repository at this point in the history
Signed-off-by: Yilin Chen <sticnarf@gmail.com>
  • Loading branch information
sticnarf committed May 29, 2019
1 parent 998de19 commit 1a3a0bc
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions src/coprocessor/dag/aggr_fn/impl_first.rs
Expand Up @@ -18,24 +18,14 @@ pub struct AggrFnDefinitionParserFirst;
impl super::AggrDefinitionParser for AggrFnDefinitionParserFirst {
fn check_supported(&self, aggr_def: &Expr) -> Result<()> {
assert_eq!(aggr_def.get_tp(), ExprType::First);
if aggr_def.get_children().len() != 1 {
return Err(box_err!(
"Expect 1 parameter, but got {}",
aggr_def.get_children().len()
));
}

// Check whether parameter expression is supported.
RpnExpressionBuilder::check_expr_tree_supported(&aggr_def.get_children()[0])?;

Ok(())
super::util::check_aggr_exp_supported_one_child(aggr_def)
}

fn parse(
&self,
mut aggr_def: Expr,
time_zone: &Tz,
max_columns: usize,
_src_schema: &[FieldType],
out_schema: &mut Vec<FieldType>,
out_exp: &mut Vec<RpnExpression>,
) -> Result<Box<dyn super::AggrFunction>> {
Expand Down

0 comments on commit 1a3a0bc

Please sign in to comment.