Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't inherit parent's reloptions if child partition's AM differs #375

Merged
merged 1 commit into from
Jan 31, 2024
Merged

Don't inherit parent's reloptions if child partition's AM differs #375

merged 1 commit into from
Jan 31, 2024

Conversation

yjhjstz
Copy link
Member

@yjhjstz yjhjstz commented Jan 31, 2024

pick from gpdb.

This commit addresses an issue arising when creating a partitioned table with its child partitions using the classic partitioning syntax in one command. Semantically, if both the parent and the child table had specified reloptions (using the WITH clause), the child's reloptions would override the parent's.

However, in Greenplum 7, with the integration of the table AM API, the internal parsing of "appendonly" and "orientation" as reloptions has been phased out. Instead, the syntax "USING ao_{row,column}" has been standardized, effectively making "WITH (appendonly=true, orientation=xxx)" an alias.

Thus, if a child partition is created using the classic syntax, and it uses a different table access method than its parent but doesn't specify any "real" reloptions, it's better for the child not to inherit the parent's reloptions. This is because the parent's reloptions may not be compatible with the child's access method.

This commit ensures that a child partition doesn't inherit the parent's reloptions when their table access methods are different.

Fixes #14913

Reported-by: Andrew Repp [email protected]
Reviewed-by: Huansong Fu [email protected]

fix #ISSUE_Number


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?

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:

  • Make sure your Pull Request has a clear title and commit message. You can take git-commit template as a reference.
  • Sign the Contributor License Agreement as prompted for your first-time contribution(One-time setup).
  • Learn the coding contribution guide, including our code conventions, workflow and more.
  • List your communication in the GitHub Issues or Discussions (if has or needed).
  • Document changes.
  • Add tests for the change
  • Pass make installcheck
  • Pass make -C src/test installcheck-cbdb-parallel
  • Feel free to request cloudberrydb/dev team for review and approval when your PR is ready🥳

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

…5975)

This commit addresses an issue arising when creating a partitioned
table with its child partitions using the classic partitioning syntax
in one command. Semantically, if both the parent and the child table
had specified reloptions (using the WITH clause), the child's
reloptions would override the parent's.

However, in Greenplum 7, with the integration of the table AM API, the
internal parsing of "appendonly" and "orientation" as reloptions has
been phased out. Instead, the syntax "USING ao_{row,column}" has been
standardized, effectively making "WITH (appendonly=true,
orientation=xxx)" an alias.

Thus, if a child partition is created using the classic syntax, and it
uses a different table access method than its parent but doesn't
specify any "real" reloptions, it's better for the child not to inherit
the parent's reloptions. This is because the parent's reloptions may
not be compatible with the child's access method.

This commit ensures that a child partition doesn't inherit the
parent's reloptions when their table access methods are different.

Fixes #14913

Reported-by: Andrew Repp <[email protected]>
Reviewed-by: Huansong Fu <[email protected]>
@yjhjstz yjhjstz merged commit c1d94b4 into apache:main Jan 31, 2024
8 of 9 checks passed
@yjhjstz yjhjstz deleted the fix-part-relopt-ddl branch January 31, 2024 07:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants