Skip to content

Commit

Permalink
Fix null on overflow and multiply, and support cast varchar to decimal (
Browse files Browse the repository at this point in the history
oap-project#169)

* Fix null on overflow and multiply as spark precision.
* Fix cast double to decimal.
* Support casting from varchar to decimal.
  • Loading branch information
jinchengchenghh authored and zhejiangxiaomai committed Apr 20, 2023
1 parent 507e4a8 commit 9704820
Show file tree
Hide file tree
Showing 9 changed files with 906 additions and 364 deletions.
7 changes: 7 additions & 0 deletions velox/common/base/BitUtil.h
Original file line number Diff line number Diff line change
Expand Up @@ -693,6 +693,13 @@ inline int32_t countLeadingZeros(uint64_t word) {
return __builtin_clzll(word);
}

inline int32_t countLeadingZerosUint128(__uint128_t word) {
uint64_t hi = word >> 64;
uint64_t lo = static_cast<uint64_t>(word);
return (hi == 0) ? 64 + bits::countLeadingZeros(lo)
: bits::countLeadingZeros(hi);
}

inline uint64_t nextPowerOfTwo(uint64_t size) {
if (size == 0) {
return 0;
Expand Down
Loading

0 comments on commit 9704820

Please sign in to comment.