Navigation Menu

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 support for extended precision integers and decimals #13097

Merged

Conversation

4ertus2
Copy link
Contributor

@4ertus2 4ertus2 commented Jul 29, 2020

I hereby agree to the terms of the CLA available at: https://yandex.ru/legal/cla/?lang=en

Changelog category (leave one):

  • New Feature

Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):
Add types Int128, Int256, UInt256 and related functions for them. Extend Decimals with Decimal256 (precision up to 76 digits). New types are under the setting allow_experimental_bigint_types.

Detailed description / Documentation draft:

  • Int128 realized over __int128 gcc/clang extention type.
  • 256-bit types made over boost::multiprecision
  • UInt128 is not implemented. We need some good unsigned __int128 implementation that would be OK for UInt128 and UUID.

Continuation of #10388

@4ertus2 4ertus2 marked this pull request as ready for review August 14, 2020 14:44
@4ertus2
Copy link
Contributor Author

4ertus2 commented Aug 19, 2020

There were several attempts to fix unbundled build in this PR. The reason of fail is hack for numeric_limits<__int128> is not working anymore.

There was a pef degradation in UUID hashes. Improved by perf optimization. There're some other strange perf degradations - not related to this patch.

@4ertus2 4ertus2 merged commit becc186 into ClickHouse:master Aug 19, 2020
traceon added a commit to traceon/ClickHouse that referenced this pull request Aug 20, 2020
* master: (43 commits)
  Publish list of tests that failed the concurrent fast test
  fix test
  Use gnu++2a instead of c++2a for unbundled build to fix numeric_limits<__int128>
  fix test
  Update 01453_fixsed_string_sort.sql
  Added test.
  Fix ColumnString::updatePermutationWithCollation.
  Add support for extended precision integers and decimals (ClickHouse#13097)
  remove retries
  Check that ya.make files are auto-generated
  Fix "Arcadia"
  ISSUES-4006 trigger CI again
  fixed typo arrayCompact
  Stratify nans comparison in arrayCompact function
  Remove even more useless code
  Remove useless code around zkutil
  Fix 00956_sensitive_data_masking flackiness
  Update docker/test/stress/run.sh
  add exclusive DDLGuard for database
  Fix handling embedded config.
  ...
static constexpr bool is_POD = !is_big_int_v<T>;
using Container = std::conditional_t<is_POD,
PaddedPODArray<ValueType>,
std::vector<ValueType>>;
Copy link
Contributor

Choose a reason for hiding this comment

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

ColumnArray::sizeAt(n) may pass -1. It's safe for PaddedPODArray since it always allocate some unused bytes at the begin and end of the array. However it's dangerous for std::vector.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr-feature Pull request with new product feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants