New contrib/fixeddecimal: add support for Cloudberry#1584
New contrib/fixeddecimal: add support for Cloudberry#1584tuhaihe wants to merge 32 commits intoapache:mainfrom
Conversation
1. Added typmod enforcement for fixednumeric. 2. Added hash index support. 3. Added missing copywrite notice 4. Added tests for indexes
This cast only serves to check that the typmod is valid or the fixeddecimal. So we only need to bother doing this when the typmod is actually present, i.e, not -1.
Also fixed small cast compiler warning in paramter to hash_any()
The problem was that the .sql file for the extension created a BRIN op class. The solution to this was to move the CREATE OPERATOR CLASS for BRIN to another file and have the makefile dynamically build the .sql file for the extension based on which version of Postgres we're building for. For versions < 9.5 we don't include BRIN. This also required similar logic for the BRIN tests. To fix this I've moved the BRIN test to a separate file, which is now only tested in version >= 9.5
This adds support for XL's concept of aggregate collect functions which allows the aggregate to be partially calculated on each node, and the agg state to be passed to another node to allow the final aggregation to take place. Also added sanity checks for bogus values of FIXEDDECIMAL_SCALE Also removed accidental commit of regression test actual result files.
Patch by Pavan Deolasee
This change adds logic to the Makefile to detect when running on Postgres-XL and run XL specific tests for this case.
Added credits, comments and legal wording prior to release
Also add various functions to allow cross type operators to save having to cast lesser types up to fixeddecimal. Please note that the upgrade script to upgrade from 1.0.0 to 1.1.0 is currently only for 9.6 and beyond. If you're running XL or 9.5 or less this script will need to be altered.
Clarify explanations
Test for all versions from 9.5 to 12. Rework makefile Signed-off-by: Florin Irion <[email protected]>
Add fixeddecimal to contrib recursive targets so it is built and tested with the rest of contrib modules. Rework contrib/fixeddecimal/Makefile to support both in-tree and PGXS builds: - use standard contrib in-tree includes (src/Makefile.global + contrib-global.mk) - keep USE_PGXS path for out-of-tree usage - remove hard dependency on pg_config for in-tree builds - fix generated SQL dependency path handling when srcdir is empty Fix fixeddecimal runtime issues seen in distributed aggregate execution: - avoid MAXINT8LEN macro conflict with core headers - switch int64 overflow checks to pg_add_s64_overflow/pg_sub_s64_overflow - harden aggregate state serialize/deserialize against NULL states - restore memory context before early return in aggregate combine Update fixeddecimal regression expected files for Cloudberry behavior (distribution-key NOTICEs, GPORCA plans, and distributed index semantics). With these changes, fixeddecimal builds, installs, and passes installcheck as a regular contrib extension in Cloudberry.
Add compliance metadata for the newly imported contrib/fixeddecimal extension. - Add fixeddecimal license notice entry under the "Apache Cloudberry includes codes from" section in LICENSE (PostgreSQL License, with a pointer to licenses/LICENSE-fixeddecimal.txt). - Add licenses/LICENSE-fixeddecimal.txt with fixeddecimal attribution and PostgreSQL license text. - Add Apache RAT exclusion for contrib/fixeddecimal/** in pom.xml, and place it in the Cloudberry-origin section (not the Greenplum section). This keeps license attribution and RAT classification aligned with fixeddecimal’s origin and repository organization.
9850670 to
3bfd28a
Compare
leborchuk
left a comment
There was a problem hiding this comment.
This is the cloudberry version of https://github.com/2ndQuadrant/fixeddecimal/commits/master/ extension.
See that all 30 original commits are in a place, extension was added to CI workflow and tests are green.
The original licence is
fixeddecimal is open source using The PostgreSQL Licence, copyright is novated to the PostgreSQL Global Development Group.
And it reflects in LICENSE-fixeddecimal.txt file.
LGTM
avamingli
left a comment
There was a problem hiding this comment.
And why we must add this contrib into repo?
| ------------------------------------------- | ||
| Index Scan using fixdec_d_idx on fixdec | ||
| Index Cond: (d = '12.34'::fixeddecimal) | ||
| (2 rows) | ||
| QUERY PLAN | ||
| ------------------------------------------ | ||
| Gather Motion 3:1 (slice1; segments: 3) | ||
| -> Seq Scan on fixdec | ||
| Filter: (d = '12.34'::fixeddecimal) | ||
| Optimizer: GPORCA | ||
| (4 rows) |
| Merge Key: d | ||
| -> Sort | ||
| Sort Key: d | ||
| -> Seq Scan on fixdec |
There was a problem hiding this comment.
Please fix that, not just copy the error into tests.
There was a problem hiding this comment.
The origin test is intend to test duplicated keys:
ERROR: could not create unique index "fixdec_d_idx"
DETAIL: Key (d)=(123.45) is duplicated.
ERROR: UNIQUE index must contain all columns in the table's distribution key
DETAIL: Distribution key column "id" is not included in the constraint.
There was one discussion on integrating More Extensions into Apache Cloudberryhttps://lists.apache.org/thread/o5n45tw6ok7wqpd7wdyhdgyhzlcs5t7j. fixeddecimal is one part of the work. |
Fixes #ISSUE_Number
What does this PR do?
Type of Change
Breaking Changes
Test Plan
make installcheckmake -C src/test installcheck-cbdb-parallelImpact
Performance:
User-facing changes:
Dependencies:
Checklist
Additional Context
CI Skip Instructions