Skip to content

Conversation

@shanicky
Copy link
Contributor

I hereby agree to the terms of the RisingWave Labs, Inc. Contributor License Agreement.

What's changed and what's your intention?

This pull request adds support for a new function, hex_to_int256, to various modules within the code. This new function allows for the conversion of hexadecimal values into 256-bit integers, like '0xff'. Additionally, the changes include various tests for the Int256 type and the hex_to_int256 function.

It's important to note that the input string must start with "0x" or "-0x" and the function is not case-sensitive about this.

select hex_to_int256('0xdeadbeef');
 hex_to_int256
---------------
 3735928559
(1 row)

Checklist For Contributors

  • I have written necessary rustdoc comments
  • I have added necessary unit tests and integration tests
    - [] I have added fuzzing tests or opened an issue to track them. (Optional, recommended for new SQL features Sqlsmith: Sql feature generation #7934).
  • I have demonstrated that backward compatibility is not broken by breaking changes and created issues to track deprecated features to be removed in the future. (Please refer to the issue)
  • All checks passed in ./risedev check (or alias, ./risedev c)

Checklist For Reviewers

  • I have requested macro/micro-benchmarks as this PR can affect performance substantially, and the results are shown.

Documentation

  • My PR DOES NOT contain user-facing changes.
Click here for Documentation

Types of user-facing changes

Please keep the types that apply to your changes, and remove the others.

  • Installation and deployment
  • Connector (sources & sinks)
  • SQL commands, functions, and operators
  • RisingWave cluster configuration changes
  • Other (please specify in the release note below)

Release note

@shanicky shanicky requested a review from lmatz April 12, 2023 16:03
@shanicky shanicky self-assigned this Apr 12, 2023
@shanicky shanicky linked an issue Apr 12, 2023 that may be closed by this pull request
@github-actions github-actions bot added the type/feature Type: New feature. label Apr 12, 2023
@shanicky shanicky added user-facing-changes Contains changes that are visible to users type/feature Type: New feature. and removed type/feature Type: New feature. labels Apr 12, 2023
@codecov
Copy link

codecov bot commented Apr 12, 2023

Codecov Report

Merging #9146 (66bab91) into main (d30919d) will increase coverage by 0.00%.
The diff coverage is 96.29%.

@@           Coverage Diff            @@
##             main    #9146    +/-   ##
========================================
  Coverage   70.86%   70.87%            
========================================
  Files        1199     1200     +1     
  Lines      199695   199830   +135     
========================================
+ Hits       141513   141628   +115     
- Misses      58182    58202    +20     
Flag Coverage Δ
rust 70.87% <96.29%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/common/src/types/num256.rs 63.69% <95.41%> (+19.36%) ⬆️
src/expr/src/vector_op/int256.rs 100.00% <100.00%> (ø)
src/frontend/src/binder/expr/function.rs 89.45% <100.00%> (+0.03%) ⬆️

... and 7 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Contributor

@lmatz lmatz left a comment

Choose a reason for hiding this comment

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

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

experimental type/feature Type: New feature. user-facing-changes Contains changes that are visible to users 📖✓ Covered or will be covered in the user docs.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

impl HEX_TO_INT256(varchar)->int256 for int256 type

4 participants