Skip to content

feat(noisy_sum): Add support for all numeric types in noisy_sum_gaussian(col, noise_scale) #13702

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
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

oliver6782
Copy link

Summary:

This Diff

This diff adds support for all numeric types in the noisy_sum_gaussian function.

Key changes

Testing
New test cases have been added to cover the additional numeric types.

Implementation
The implementation of the noisy_sum_gaussian function has been updated to handle the new numeric types. This includes dispatching to the corresponding type for the update sum operation.

Impact
This diff extends the functionality of the noisy_sum_gaussian function to support more numeric types, making it more versatile and useful in a wider range of applications.

Differential Revision: D75964171

Copy link

netlify bot commented Jun 10, 2025

Deploy Preview for meta-velox canceled.

Name Link
🔨 Latest commit 2c9c973
🔍 Latest deploy log https://app.netlify.com/projects/meta-velox/deploys/6849193c3fb1b7000895c6ca

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jun 10, 2025
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D75964171

oliver6782 pushed a commit to oliver6782/velox that referenced this pull request Jun 10, 2025
…ian(col, noise_scale) (facebookincubator#13702)

Summary:

## This Diff

This diff adds support for all numeric types in the `noisy_sum_gaussian` function.

### Key changes

**Testing**
New test cases have been added to cover the additional numeric types.

**Implementation**
The implementation of the `noisy_sum_gaussian` function has been updated to handle the new numeric types. This includes dispatching to the corresponding type for the update sum operation.

**Impact**
This diff extends the functionality of the `noisy_sum_gaussian` function to support more numeric types, making it more versatile and useful in a wider range of applications.

Differential Revision: D75964171
oliver6782 pushed a commit to oliver6782/velox that referenced this pull request Jun 10, 2025
…ian(col, noise_scale) (facebookincubator#13702)

Summary:

## This Diff

This diff adds support for all numeric types in the `noisy_sum_gaussian` function.

### Key changes

**Testing**
New test cases have been added to cover the additional numeric types.

**Implementation**
The implementation of the `noisy_sum_gaussian` function has been updated to handle the new numeric types. This includes dispatching to the corresponding type for the update sum operation.

**Impact**
This diff extends the functionality of the `noisy_sum_gaussian` function to support more numeric types, making it more versatile and useful in a wider range of applications.

Differential Revision: D75964171
oliver6782 pushed a commit to oliver6782/velox that referenced this pull request Jun 10, 2025
…ian(col, noise_scale) (facebookincubator#13702)

Summary:

## This Diff

This diff adds support for all numeric types in the `noisy_sum_gaussian` function.

### Key changes

**Testing**
New test cases have been added to cover the additional numeric types.

**Implementation**
The implementation of the `noisy_sum_gaussian` function has been updated to handle the new numeric types. This includes dispatching to the corresponding type for the update sum operation.

**Impact**
This diff extends the functionality of the `noisy_sum_gaussian` function to support more numeric types, making it more versatile and useful in a wider range of applications.

Differential Revision: D75964171
oliver6782 pushed a commit to oliver6782/velox that referenced this pull request Jun 10, 2025
…ian(col, noise_scale) (facebookincubator#13702)

Summary:

## This Diff

This diff adds support for all numeric types in the `noisy_sum_gaussian` function.

### Key changes

**Testing**
New test cases have been added to cover the additional numeric types.

**Implementation**
The implementation of the `noisy_sum_gaussian` function has been updated to handle the new numeric types. This includes dispatching to the corresponding type for the update sum operation.

**Impact**
This diff extends the functionality of the `noisy_sum_gaussian` function to support more numeric types, making it more versatile and useful in a wider range of applications.

Differential Revision: D75964171
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D75964171

oliver6782 pushed a commit to oliver6782/velox that referenced this pull request Jun 10, 2025
…ian(col, noise_scale) (facebookincubator#13702)

Summary:
Pull Request resolved: facebookincubator#13702

## This Diff

This diff adds support for all numeric types in the `noisy_sum_gaussian` function.

### Key changes

**Testing**
New test cases have been added to cover the additional numeric types.

**Implementation**
The implementation of the `noisy_sum_gaussian` function has been updated to handle the new numeric types. This includes dispatching to the corresponding type for the update sum operation.

**Impact**
This diff extends the functionality of the `noisy_sum_gaussian` function to support more numeric types, making it more versatile and useful in a wider range of applications.

Differential Revision: D75964171
oliver6782 pushed a commit to oliver6782/velox that referenced this pull request Jun 11, 2025
…ian(col, noise_scale) (facebookincubator#13702)

Summary:

## This Diff

This diff adds support for all numeric types in the `noisy_sum_gaussian` function.

### Key changes

**Testing**
New test cases have been added to cover the additional numeric types.

**Implementation**
The implementation of the `noisy_sum_gaussian` function has been updated to handle the new numeric types. This includes dispatching to the corresponding type for the update sum operation.

**Impact**
This diff extends the functionality of the `noisy_sum_gaussian` function to support more numeric types, making it more versatile and useful in a wider range of applications.

Differential Revision: D75964171
oliver6782 pushed a commit to oliver6782/velox that referenced this pull request Jun 11, 2025
…ian(col, noise_scale) (facebookincubator#13702)

Summary:

## This Diff

This diff adds support for all numeric types in the `noisy_sum_gaussian` function.

### Key changes

**Testing**
New test cases have been added to cover the additional numeric types.

**Implementation**
The implementation of the `noisy_sum_gaussian` function has been updated to handle the new numeric types. This includes dispatching to the corresponding type for the update sum operation.

**Impact**
This diff extends the functionality of the `noisy_sum_gaussian` function to support more numeric types, making it more versatile and useful in a wider range of applications.

Differential Revision: D75964171
oliver6782 pushed a commit to oliver6782/velox that referenced this pull request Jun 11, 2025
…ian(col, noise_scale) (facebookincubator#13702)

Summary:

## This Diff

This diff adds support for all numeric types in the `noisy_sum_gaussian` function.

### Key changes

**Testing**
New test cases have been added to cover the additional numeric types.

**Implementation**
The implementation of the `noisy_sum_gaussian` function has been updated to handle the new numeric types. This includes dispatching to the corresponding type for the update sum operation.

**Impact**
This diff extends the functionality of the `noisy_sum_gaussian` function to support more numeric types, making it more versatile and useful in a wider range of applications.

Differential Revision: D75964171
oliver6782 pushed a commit to oliver6782/velox that referenced this pull request Jun 11, 2025
…ian(col, noise_scale) (facebookincubator#13702)

Summary:

## This Diff

This diff adds support for all numeric types in the `noisy_sum_gaussian` function.

### Key changes

**Testing**
New test cases have been added to cover the additional numeric types.

**Implementation**
The implementation of the `noisy_sum_gaussian` function has been updated to handle the new numeric types. This includes dispatching to the corresponding type for the update sum operation.

**Impact**
This diff extends the functionality of the `noisy_sum_gaussian` function to support more numeric types, making it more versatile and useful in a wider range of applications.

Differential Revision: D75964171
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D75964171

oliver6782 pushed a commit to oliver6782/velox that referenced this pull request Jun 11, 2025
…ian(col, noise_scale) (facebookincubator#13702)

Summary:
Pull Request resolved: facebookincubator#13702

## This Diff

This diff adds support for all numeric types in the `noisy_sum_gaussian` function.

### Key changes

**Testing**
New test cases have been added to cover the additional numeric types.

**Implementation**
The implementation of the `noisy_sum_gaussian` function has been updated to handle the new numeric types. This includes dispatching to the corresponding type for the update sum operation.

**Impact**
This diff extends the functionality of the `noisy_sum_gaussian` function to support more numeric types, making it more versatile and useful in a wider range of applications.

Differential Revision: D75964171
oliverxu added 5 commits June 10, 2025 22:45
…se_scale) (facebookincubator#13651)

Summary:
Pull Request resolved: facebookincubator#13651

**Summary**
This diff adds more unit tests so that the noisy function is more robust.

**Changes**
* Added tests that aggregate on non-scalar inputs such as array and map.
* Added edge case where the input is empty.

Differential Revision: D75916564
…gaussian(col, noise_scale) (facebookincubator#13652)

Summary:
Pull Request resolved: facebookincubator#13652

Add support for noise_scale of BIGINT type.

Differential Revision: D75925753
…andom_seed) (facebookincubator#13653)

Summary:
Pull Request resolved: facebookincubator#13653

### Summary
This diff introduces random seed to the `noisy_count_gaussian` function  to seed the random number generator.

### Changes
* Added a new test cases to `NoisyCountGaussianAggregationTest.cpp`.
* Updated the `noisy_count_gaussian` function documentation to include the `random_seed` parameter.
* Modified the `NoisyCountGaussianAggregate.cpp` file to decode the `random_seed` argument and use it to seed the random number generator.

### Impact
This diff enhances the `noisy_count_gaussian` function by providing an optional `random_seed` parameter, allowing users to reproduce the same noisy count results. The new test case ensures that the function works correctly with multiple aggregates and groups.

Differential Revision: D75926651
…e functions. (facebookincubator#13661)

Summary:
Pull Request resolved: facebookincubator#13661

### Summary

This diff refactors duplicate blocks of code to composable functions in the `NoisyCountGaussianAggregate` class.

### Key Changes

* Removed duplicate code blocks and replaced them with calls to new composable functions

### Files Changed

* `fbcode/velox/functions/prestosql/aggregates/NoisyCountGaussianAggregate.cpp`

### Overall Impact

This refactoring improves the maintainability and readability of the code by eliminating duplicates and simplifying the logic.

Differential Revision: D76084043
…bookincubator#13701)

Summary:
Pull Request resolved: facebookincubator#13701

### This Diff

This diff implements a new aggregate function `noisy_sum_gaussian` which calculates the sum over the input values and adds a normally distributed random double value with 0 mean and standard deviation of `noise_scale`.

### File Changes

The following files were changed:

* `RegisterAggregateFunctions.cpp` - registered the new aggregate function
* `NoisySumAccumulator` - new file to support aggregation.
* `NoisySumGaussianAggregate` - new file for the aggregate function implementation.
* `NoisySumGaussianAggregationTest` - new file to carry out simple unit test.
* `FacebookPrestoExpressionFuzzerTest.cpp` - added the new function to the list of non-deterministic functions to skip
* `aggregate.rst` - added documentation for the new function
* `FacebookAggregationFuzzerTest.cpp` - added the new function to the list of non-deterministic functions to skip

### Impact

This new function adds a way to calculate a noisy sum of values, which can be useful in statistical analysis.

Differential Revision: D75928375
oliver6782 pushed a commit to oliver6782/velox that referenced this pull request Jun 11, 2025
…ian(col, noise_scale) (facebookincubator#13702)

Summary:

## This Diff

This diff adds support for all numeric types in the `noisy_sum_gaussian` function.

### Key changes

**Testing**
New test cases have been added to cover the additional numeric types.

**Implementation**
The implementation of the `noisy_sum_gaussian` function has been updated to handle the new numeric types. This includes dispatching to the corresponding type for the update sum operation.

**Impact**
This diff extends the functionality of the `noisy_sum_gaussian` function to support more numeric types, making it more versatile and useful in a wider range of applications.

Differential Revision: D75964171
…ian(col, noise_scale) (facebookincubator#13702)

Summary:
Pull Request resolved: facebookincubator#13702

## This Diff

This diff adds support for all numeric types in the `noisy_sum_gaussian` function.

### Key changes

**Testing**
New test cases have been added to cover the additional numeric types.

**Implementation**
The implementation of the `noisy_sum_gaussian` function has been updated to handle the new numeric types. This includes dispatching to the corresponding type for the update sum operation.

**Impact**
This diff extends the functionality of the `noisy_sum_gaussian` function to support more numeric types, making it more versatile and useful in a wider range of applications.

Differential Revision: D75964171
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D75964171

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants