From bec3f9464723b4c959d06636c6c1fa1f63c0b531 Mon Sep 17 00:00:00 2001 From: Dennis Felsing Date: Fri, 13 Oct 2023 11:16:02 +0000 Subject: [PATCH] Enable window functions Depends on https://github.com/MaterializeInc/materialize/pull/22270 --- expr.cc | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/expr.cc b/expr.cc index 99640bf..5f62e92 100644 --- a/expr.cc +++ b/expr.cc @@ -17,9 +17,8 @@ using impedance::matched; shared_ptr value_expr::factory(prod *p, sqltype *type_constraint, bool can_return_set) { try { - // ERROR: aggregate window functions not yet supported - //if (1 == d20() && p->level < d6() && window_function::allowed(p)) - // return make_shared(p, type_constraint); + if (1 == d20() && p->level < d6() && window_function::allowed(p)) + return make_shared(p, type_constraint); if (1 == d42() && p->level < d6() && type_constraint && type_constraint->name.rfind("list", 0) != 0 && type_constraint->name.rfind("map", 0) != 0 && type_constraint->name.rfind("record", 0) != 0 && type_constraint->name.rfind("any", 0) != 0) return make_shared(p, type_constraint); else if (1 == d42() && p->level < d6() && type_constraint && type_constraint->name.rfind("list", 0) != 0 && type_constraint->name.rfind("map", 0) != 0 && type_constraint->name.rfind("record", 0) != 0 && type_constraint->name.rfind("any", 0) != 0) @@ -557,7 +556,7 @@ window_function::window_function(prod *p, sqltype *type_constraint) : value_expr(p) { match(); - aggregate = make_shared(this, type_constraint, true); + aggregate = make_shared(this, type_constraint, true, true); type = aggregate->type; partition_by.push_back(make_shared(this)); while(d6() > 4)