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
Improve reloptions validation for partitioned tables using non-default AMs
Previously, when creating a partitioned table without an explicit
`USING` clause, the reloptions (such as minmax_columns) were validated
with the assumption that the default_table_access_method is either
'heap', 'ao_row', or 'ao_column'. This could incorrectly reject valid
reloptions intended for other table access methods like 'pax'.
This patch adjusts the validation logic in DefineRelation() so that
reloptions are only validated for partitioned tables if the default
AM is one of the known AMs that support reloptions validation. For
non-default AMs, reloptions are passed unvalidated to allow extensions
to handle them properly.
This change enables successful creation of partitioned tables using
`USING pax WITH (minmax_columns=...)` without validation errors, even
when `default_table_access_method` is set to 'pax'.
partition by range(c1) (start(1) end(15000) every(5000))
95
+
with (minmax_columns='c1,c2,c3,c4,c5,c6,c7,c8,c9');
96
+
NOTICE: Table doesn't have 'DISTRIBUTED BY' clause -- Using column named 'c1' as the Apache Cloudberry data distribution key for this table.
97
+
HINT: The 'DISTRIBUTED BY' clause determines the distribution of data. Make sure column(s) chosen are the optimal data distribution key to minimize skew.
partition by range(c1) (start(1) end(15000) every(5000))
101
+
using pax with (minmax_columns='c1,c2,c3,c4,c5,c6,c7,c8,c9');
102
+
NOTICE: Table doesn't have 'DISTRIBUTED BY' clause -- Using column named 'c1' as the Apache Cloudberry data distribution key for this table.
103
+
HINT: The 'DISTRIBUTED BY' clause determines the distribution of data. Make sure column(s) chosen are the optimal data distribution key to minimize skew.
partition by range(c1) (start(1) end(15000) every(5000))
108
+
with (minmax_columns='c1,c2,c3,c4,c5,c6,c7,c8,c9');
109
+
NOTICE: Table doesn't have 'DISTRIBUTED BY' clause -- Using column named 'c1' as the Apache Cloudberry data distribution key for this table.
110
+
HINT: The 'DISTRIBUTED BY' clause determines the distribution of data. Make sure column(s) chosen are the optimal data distribution key to minimize skew.
Copy file name to clipboardExpand all lines: contrib/pax_storage/src/test/regress/input/partition_ddl.source
+1Lines changed: 1 addition & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -999,6 +999,7 @@ create table part_heap1(a int, b int) using heap with (fillfactor=70) partition
999
999
select c.relname, am.amname, c.reloptions from pg_partition_tree('part_heap1') as t join pg_class c on (t.relid::oid = c.oid) left join pg_am am on (c.relam = am.oid);
1000
1000
1001
1001
-- Test 3: Parent's reloptions are explicitly specified, and parent's AM is implicitly specified as heap
1002
+
set default_table_access_method = heap;
1002
1003
create table part_heap2(a int, b int) with (fillfactor=70) partition by range(b) (partition p1 start(0) end(10) with(appendonly=true));
1003
1004
select c.relname, am.amname, c.reloptions from pg_partition_tree('part_heap2') as t join pg_class c on (t.relid::oid = c.oid) left join pg_am am on (c.relam = am.oid);
Copy file name to clipboardExpand all lines: contrib/pax_storage/src/test/regress/output/partition_ddl.source
+1Lines changed: 1 addition & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -2902,6 +2902,7 @@ select c.relname, am.amname, c.reloptions from pg_partition_tree('part_heap1') a
2902
2902
(2 rows)
2903
2903
2904
2904
-- Test 3: Parent's reloptions are explicitly specified, and parent's AM is implicitly specified as heap
2905
+
set default_table_access_method = heap;
2905
2906
create table part_heap2(a int, b int) with (fillfactor=70) partition by range(b) (partition p1 start(0) end(10) with(appendonly=true));
2906
2907
ERROR: unrecognized parameter "fillfactor"
2907
2908
select c.relname, am.amname, c.reloptions from pg_partition_tree('part_heap2') as t join pg_class c on (t.relid::oid = c.oid) left join pg_am am on (c.relam = am.oid);
0 commit comments