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

Fix partition creation to handle MAXVALUE in subpartition bounds #904

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

avamingli
Copy link
Contributor

Previously, the simplified partition creation syntax in GPDB did not properly handle MAXVALUE as a boundary value for subpartitions.

The fix allows users to define subpartitions with MAXVALUE boundaries using the simplified partition creation syntax, maintaining compatibility with existing partition functionality.

During the fix, it was also identified that MINVALUE has a similar issue.
However, addressing MINVALUE is more complex due to the current implementation of the START/EVERY/END grammar, which only considers the end boundary situation.
A broader refactor of the partition creation logic may be required to properly support MINVALUE in subpartition definitions.

Fixes: #795

Authored-by: Zhang Mingli [email protected]

Fixes #ISSUE_Number

What does this PR do?

Type of Change

  • Bug fix (non-breaking change)
  • New feature (non-breaking change)
  • Breaking change (fix or feature with breaking changes)
  • Documentation update

Breaking Changes

Test Plan

  • Unit tests added/updated
  • Integration tests added/updated
  • Passed make installcheck
  • Passed make -C src/test installcheck-cbdb-parallel

Impact

Performance:

User-facing changes:

Dependencies:

Checklist

Additional Context

CI Skip Instructions


Previously, the simplified partition creation syntax in GPDB did not
properly handle MAXVALUE as a boundary value for subpartitions.

The fix allows users to define subpartitions with MAXVALUE boundaries
using the simplified partition creation syntax, maintaining
compatibility with existing partition functionality.

During the fix, it was also identified that MINVALUE has a similar
issue.
However, addressing MINVALUE is more complex due to the current
implementation of the START/EVERY/END grammar, which only considers
the end boundary situation.
A broader refactor of the partition creation logic may be required to
properly support MINVALUE in subpartition definitions.

Fixes: apache#795

Authored-by: Zhang Mingli [email protected]
/*
* ColumnRef is not in the desired single-field-name form. For
* consistency between all partition strategies, let the
* expression transformation report any errors rather than
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what case cname will be NULL ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The cname will be NULL when the ColumnRef does not conform to the expected single-field-name format. As stated in the comment, this is a safeguard for consistency across all partition strategies. By allowing the expression transformation to report any errors in such cases, we can prevent potential crashes that might occur from processing invalid ColumnRef structures

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.

[Bug] Fail to create table with partition description with MAXVALUE in Greenplum like syntax
3 participants