apache / cloudberry

One advanced and mature open-source MPP (Massively Parallel Processing) database. Open source alternative to Greenplum Database.
https://cloudberry.apache.org
Apache License 2.0
417 stars 104 forks source link

Make gp-style partition table compatible with greenplum #695

Open gfphoenix78 opened 3 weeks ago

gfphoenix78 commented 3 weeks ago

Adding a new partition should have the same behavior like greenplum 6/7. The child partition inherits access method, reloptions, column encodings from its parent if no specific options are provided


Change logs

Describe your change clearly, including what problem is being solved or what feature is being added.

If it has some breaking backward or forward compatibility, please clary.

Why are the changes needed?

Describe why the changes are necessary.

Does this PR introduce any user-facing change?

If yes, please clarify the previous behavior and the change this PR proposes.

How was this patch tested?

CREATE TABLE star.trd_fct (
trd_date_key date NOT NULL ,
prod_key integer NOT NULL ,
cust_key integer NOT NULL ,
notional_val numeric(20,10) ,
num_of_shares integer ,
num_of_trades integer ,
trd_id bigint NOT NULL ,
ins_ts timestamp DEFAULT CURRENT_TIMESTAMP NOT NULL
)

WITH (
appendoptimized=true
,orientation=row
,compresstype=zlib
,compresslevel=5
)
DISTRIBUTED RANDOMLY
PARTITION BY RANGE (trd_date_key) (
START ('2020-01-01'::date) INCLUSIVE
END ('2027-01-01'::date) EXCLUSIVE
EVERY (interval '1 Year')
)
;

alter table star.trd_fct add partition start ('2027-01-01') inclusive end ('2028-01-01') exclusive;

Please detail how the changes were tested, including manual tests and any relevant unit or integration tests.

Contributor's Checklist

Here are some reminders and checklists before/when submitting your pull request, please check them:

my-ship-it commented 2 weeks ago

Please add some test cases, thanks

reshke commented 2 weeks ago

Hi, I have failure with this change

db2=# \d+ star.trd_fct
row number 0 is out of range 0..-1
row number 0 is out of range 0..-1
cannot duplicate null pointer (internal error)
reshke commented 2 weeks ago

Hi, I have failure with this change

db2=# \d+ star.trd_fct
row number 0 is out of range 0..-1
row number 0 is out of range 0..-1
cannot duplicate null pointer (internal error)

Oh, sorry, looks like this is not related to current pr. I will take a look. Issue persist on master

reshke commented 2 weeks ago

Hi, I have failure with this change

db2=# \d+ star.trd_fct
row number 0 is out of range 0..-1
row number 0 is out of range 0..-1
cannot duplicate null pointer (internal error)

https://github.com/cloudberrydb/cloudberrydb/issues/697

reshke commented 2 weeks ago

I found another issue https://github.com/cloudberrydb/cloudberrydb/issues/698. we can fix this within this pr, or i can created separate pr for this.

gfphoenix78 commented 2 weeks ago

Please add some test cases, thanks

Sure, the PR isn't fully ready yet. I'll some the full test when inherited encoding attributes are supported.

tuhaihe commented 1 week ago

Hi @reshke Do you link your GitHub account with your Apache ID? It seems that your approval does not have binding access. Welcome to visit https://gitbox.apache.org/boxer/ to double-check.