Skip to content

Conversation

@jiaqizho
Copy link
Contributor

fix #ISSUE_Number


Change logs

CBDB not allow building pg numeric from other formats. Numeric objects can only be constructed from string, which means that the caller needs to convert its own data into a specific format string, then convert the string into numeric. This is a very inefficient method.

Current change provider a new method int128_to_numeric which used to build a numeric from int128. Also, current method allow build special numeric or build numeric with scale.

Why are the changes needed?

Allow caller build numeric from int128

Does this PR introduce any user-facing change?

nope

How was this patch tested?

ci

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🥳

@jiaqizho jiaqizho requested a review from my-ship-it February 22, 2024 07:58
@jiaqizho jiaqizho force-pushed the feature-extend-numeric branch from f2f97e8 to 26df32a Compare February 26, 2024 09:00
@jiaqizho jiaqizho force-pushed the feature-extend-numeric branch from 26df32a to f6acd00 Compare March 1, 2024 09:33

#ifdef HAVE_INT128
Numeric
int128_to_numeric(int128 val, int scale, bool neg,
Copy link
Contributor

Choose a reason for hiding this comment

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

No need to change in numeric.c?

@jiaqizho
Copy link
Contributor Author

after #392 , no need current change any more.

@jiaqizho jiaqizho closed this Mar 11, 2024
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