(ctx: CtxRef, input: ParseStream)
| 453 | } |
| 454 | |
| 455 | fn parse_distinct(ctx: CtxRef, input: ParseStream) -> Result { |
| 456 | let reduce = input.parse::<kw::Distinct>()?; |
| 457 | |
| 458 | let group_key = if input.eat(kw::project) { |
| 459 | input.parse::<syn::Token![=]>()?; |
| 460 | let inner; |
| 461 | syn::bracketed!(inner in input); |
| 462 | inner.parse_comma_sep(scalar::parse_expr)? |
| 463 | } else { |
| 464 | vec![] |
| 465 | }; |
| 466 | |
| 467 | let monotonic = input.eat(kw::monotonic); |
| 468 | |
| 469 | let expected_group_size = if input.eat(kw::exp_group_size) { |
| 470 | input.parse::<syn::Token![=]>()?; |
| 471 | Some(input.parse::<syn::LitInt>()?.base10_parse::<u64>()?) |
| 472 | } else { |
| 473 | None |
| 474 | }; |
| 475 | |
| 476 | let parse_inputs = ParseChildren::new(input, reduce.span().start()); |
| 477 | let input = Box::new(parse_inputs.parse_one(ctx, parse_expr)?); |
| 478 | |
| 479 | Ok(MirRelationExpr::Reduce { |
| 480 | input, |
| 481 | group_key, |
| 482 | aggregates: vec![], |
| 483 | monotonic, |
| 484 | expected_group_size, |
| 485 | }) |
| 486 | } |
| 487 | |
| 488 | fn parse_reduce(ctx: CtxRef, input: ParseStream) -> Result { |
| 489 | let reduce = input.parse::<kw::Reduce>()?; |
no test coverage detected