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

Add attribute encoding to partition roots #974

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

Conversation

reshke
Copy link
Contributor

@reshke reshke commented Mar 1, 2025

This commit adds pg_attribute_encoding entries for root partitions, During create statement, we add attribute encoding entries to catalog If the table has a parent partition, and no options or encodings are specified, we copy the parent partition's encoding entries

For partitioned table create statement, we pick
the explicitly defined column encoding for the parent over the table-level option defined for the child partition.

The storage encoding clause for a column is picked as follows:

    1. An explicit encoding clause in the ColumnDef of self/parent
    1. A column reference storage directive for this column
    1. A default column encoding in the statement
    1. Parent partition's column encoding values
    1. A default for the type.

Add attribute encodings to d+ description for root partitions

Added tests to check comlumn encoding inheritance priority

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


This commit adds pg_attribute_encoding entries for root partitions,
During create statement, we add attribute encoding entries to catalog
If the table has a parent partition, and no options or encodings are
specified, we copy the parent partition's encoding entries

For partitioned table create statement, we pick
the explicitly defined column encoding for the parent
over the table-level option defined for the child partition.

The storage encoding clause for a column is picked as follows:
 * 1. An explicit encoding clause in the ColumnDef of self/parent
 * 2. A column reference storage directive for this column
 * 3. A default column encoding in the statement
 * 4. Parent partition's column encoding values
 * 5. A default for the type.

Add attribute encodings to d+ description for root partitions

Added tests to check comlumn encoding inheritance priority
@reshke reshke marked this pull request as draft March 1, 2025 10:45
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.

2 participants