You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug] [AQUMV]ERROR: invalid attnum 3 for relation "aqumv_t2" (ruleutils.c:7260) #344
When compute AGG on views, an error of invalid attnum occured.
What you think should happen instead
No response
How to reproduce
begin;
createtableaqumv_t2(c1 int, c2 int, c3 int) distributed by (c1);
insert into aqumv_t2 select i, i+1, i+2from generate_series(1, 100) i;
insert into aqumv_t2 values (91, NULL, 95);
analyze aqumv_t2;
create incremental materialized view aqumv_mvt2_1 asselect c3 as mc3, c1 as mc1
from aqumv_t2 where c1 >90;
NOTICE: Table doesn't have 'DISTRIBUTED BY' clause -- Using column(s) named 'mc1' as the Cloudberry Database data distribution key for this table.HINT: The 'DISTRIBUTED BY' clause determines the distribution of data. Make sure column(s) chosen are the optimal data distribution key to minimize skew.analyze aqumv_mvt2_1;set local enable_answer_query_using_materialized_views = off;explain(costs off, verbose)select count(c3) from aqumv_t2 where c1 > 90; QUERY PLAN ----------------------------------------------------------------------------------- Finalize Aggregate Output: count(c3) -> Gather Motion 3:1 (slice1; segments: 3) Output: (PARTIAL count(c3)) -> Partial Aggregate Output: PARTIAL count(c3) -> Seq Scan on public.aqumv_t2 Output: c1, c2, c3 Filter: (aqumv_t2.c1 > 90) Settings: enable_answer_query_using_materialized_views = 'off', optimizer = 'off' Optimizer: Postgres query optimizer(11 rows)select count(c3) from aqumv_t2 where c1 > 90; count ------- 11(1 row)set local enable_answer_query_using_materialized_views = on;explain(costs off, verbose)select count(c3) from aqumv_t2 where c1 > 90;ERROR: invalid attnum 3 for relation "aqumv_t2" (ruleutils.c:7260)select count(c3) from aqumv_t2 where c1 > 90;ERROR: current transaction is aborted, commands ignored until end of transaction blockabort;
The root cause is PlannerInfo's stuff need to be refilled after rewritten.
They may be used to fetch rels after planner, for example: use physical rel's target list in create_plan().
Activity
avamingli commentedon Dec 22, 2023
It seems related to disorder of column, but the error shows it's on origin table which is confused after rewritten.
Working on this.
avamingli commentedon Dec 25, 2023
Update: make sure this has nothing to do with TupleDesc, need dig more.
avamingli commentedon Dec 26, 2023
The root cause is PlannerInfo's stuff need to be refilled after rewritten.
They may be used to fetch rels after planner, for example: use physical rel's target list in create_plan().
avamingli commentedon Dec 29, 2023
Fixed in #348
Fix bug: diskquota.status() (#344)
Fix bug: diskquota.status() (#344)
Fix bug: diskquota.status() (#344)
Apache main rebase (#28)
Fix bug: diskquota.status() (#344)
Fix bug: diskquota.status() (apache#344)
Fix bug: diskquota.status() (apache#344)
Sync with apache main (#29)
Fix bug: diskquota.status() (apache#344)
Fix bug: diskquota.status() (apache#344)
Fix bug: diskquota.status() (apache#344)
Fix two AQUMV rewrite errors found by fuzzing
Fix two AQUMV rewrite errors found by fuzzing
Fix two AQUMV rewrite errors found by fuzzing