Materialized views enabled:
- select avg(grade), count(*), max(grade), sum(grade), min(grade), team from students group by team
- select avg(grade), count(*), max(grade), sum(grade), min(grade), team, faculty from students group by faculty, team,
- select count(*), team from students group by team
Error (stacktrace is obtained using the current master branch: "247c7d4f76"):
Reproducible only if both Materialization views listed are enabled: any single one of these two could be successfully used with the query without any errors. Looks like is is reproducible when AbstractMaterializedViewRule is trying to rewrite one materialized view using the another materialized view.
Currently, I'm trying to reproduce the issue in "MaterializationTest": without a success so far, I'll update the ticket if I'll find a working way to reproduce the issue in the test will be discovered.