forked from risingwavelabs/risingwave
-
Notifications
You must be signed in to change notification settings - Fork 0
Graphops/uint256 #2
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
Open
chriswessels
wants to merge
11
commits into
main
Choose a base branch
from
graphops/uint256
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Implements 256-bit unsigned integer type using ethnum::u256 library. - Add UINT256 to protobuf data type enum - Implement ScalarImpl, ScalarRef, and ScalarRefImpl for UInt256 - Add UInt256Array implementation with arrow compatibility - Support serialization/deserialization in value encoding - Add hash key support for uint256 values - Include test utilities for generating random uint256 values - Extend type macros to support uint256 throughout the codebase This forms the foundation for uint256 support in RisingWave's type system.
- Map uint256 to Arrow Decimal256Array for data interchange - Add iceberg compatibility mapping for uint256 type - Support uint256 literals in frontend expression system - Extend data type utilities to handle uint256 - Add JSON conversion support for uint256 values - Update index selection rule to include uint256 type Enables efficient data exchange with external systems through Arrow format.
- BigQuery: map uint256 to BIGNUMERIC type - ClickHouse: use String representation for uint256 - Doris: encode as LARGEINT string representation - DynamoDB: serialize as string attribute - SQL Server: use VARCHAR(78) for uint256 values - StarRocks: encode as LARGEINT string - Add uint256 support in Avro, JSON, and Proto encoders - Include uint256 in Debezium JSON formatter - Extend MySQL and PostgreSQL parsers for uint256 compatibility Ensures uint256 values can be properly exported to various sink systems.
- Add binary arithmetic operators: +, -, *, /, % - Implement comparison operators: <, <=, >, >=, =, <> - Extend expression type macros to support uint256 - Add uint256 literal parsing in expression binder - Register uint256 in expression type system Enables arithmetic operations and comparisons on uint256 values in SQL queries.
- Implement casts from numeric types to uint256 - Add casts from uint256 to int256 and decimal - Support string to uint256 parsing - Update cast matrix with Implicit, Assign, and Explicit contexts - Handle overflow detection in numeric conversions Allows seamless type conversions between uint256 and other numeric types.
- Add sum aggregation for uint256 values - Implement min/max aggregates with proper state handling - Support statistical aggregates: avg, stddev_pop, stddev_samp, var_pop, var_samp - All statistical functions use float8 output type Enables aggregation operations on uint256 columns in streaming and batch queries.
- PostgreSQL: convert numeric types to uint256 with validation - JSON: parse uint256 from numeric and string representations - Add error handling for invalid uint256 conversions - Support list parsing for uint256 arrays Enables ingestion of uint256 values from PostgreSQL and JSON sources.
- Assign OID 1305 for rw_uint256 base type - Assign OID 1306 for _rw_uint256 array type - Register types in pg_type system catalog - Add proper I/O functions for PostgreSQL compatibility Enables PostgreSQL clients to properly recognize and handle uint256 types.
- Test DDL operations: CREATE TABLE, ALTER TABLE with uint256 - Verify DML operations: INSERT, UPDATE, DELETE - Test arithmetic operations and overflow behavior - Validate aggregate functions: sum, min, max, avg - Test type casting from numeric types and strings - Verify connector integration with PostgreSQL and JSON sources - Add boundary value tests for uint256 range Ensures uint256 type works correctly across all SQL operations.
- Document complete uint256 type implementation plan - Mark all three phases as complete with status indicators - List known limitations (hex literals, u512 accumulator, bitwise ops) - Include implementation details and file references - Specify PostgreSQL OID assignments (1305/1306) This specification serves as both design document and implementation guide for the uint256 feature in RisingWave.
- Add SQL usage examples for DDL, DML, and queries - Document connector integration patterns for PostgreSQL, JSON, and Avro - Provide sink configuration examples for major systems - Include common patterns like Wei to Ether conversion - Document limitations and performance considerations - Add best practices for handling overflow and external system integration The user guide provides practical examples for blockchain and DeFi use cases where uint256 is commonly needed.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I hereby agree to the terms of the RisingWave Labs, Inc. Contributor License Agreement.
What's changed and what's your intention?
Checklist
Documentation
Release note