Skip to content

Fix: Normalize operator class storagetype for different DB versions#33

Merged
gfphoenix78 merged 1 commit intoapache:sync-with-upstreamfrom
robertmu:operator-fix
Sep 5, 2025
Merged

Fix: Normalize operator class storagetype for different DB versions#33
gfphoenix78 merged 1 commit intoapache:sync-with-upstreamfrom
robertmu:operator-fix

Conversation

@robertmu
Copy link
Copy Markdown
Contributor

This commit addresses a test failure in the GetOperatorClasses integration tests, which was observed on newer database versions like Cloudberry (based on PG14).

The investigation revealed an inconsistency in how Greenplum 7 (based on PG12) and Cloudberry handle the storagetype for operator classes. When an operator class's STORAGE type is the same as its FOR TYPE and opckeytype is not 0:

  • In GPDB7, the expression opckeytype::regtype evaluates to "-".
  • In CBDB, the same expression evaluates to the actual type name (e.g., "integer").

This change introduces a CASE statement to explicitly check if opcintype equals opckeytype. This normalizes the behavior across both database versions, ensuring that storagetype is consistently represented as "-" when the storage type is the same as the input type, which allows the failing test to pass.

This commit addresses a test failure in the `GetOperatorClasses` integration
tests, which was observed on newer database versions like Cloudberry
(based on PG14).

The investigation revealed an inconsistency in how Greenplum 7 (based on PG12)
and Cloudberry handle the `storagetype` for operator classes. When an operator
class's `STORAGE` type is the same as its `FOR TYPE` and `opckeytype` is not 0:
- In GPDB7, the expression `opckeytype::regtype` evaluates to "-".
- In CBDB, the same expression evaluates to the actual type name (e.g., "integer").

This change introduces a `CASE` statement to explicitly check if
`opcintype` equals `opckeytype`. This normalizes the behavior across
both database versions, ensuring that `storagetype` is consistently
represented as "-" when the storage type is the same as the input type,
which allows the failing test to pass.
@gfphoenix78 gfphoenix78 merged commit d8f3b94 into apache:sync-with-upstream Sep 5, 2025
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