Skip to content

test: Add end-to-end tests for numeric_histogram function#26968

Open
allenshen13 wants to merge 1 commit intomasterfrom
add-aggregate-e2e-tests
Open

test: Add end-to-end tests for numeric_histogram function#26968
allenshen13 wants to merge 1 commit intomasterfrom
add-aggregate-e2e-tests

Conversation

@allenshen13
Copy link
Copy Markdown
Member

@allenshen13 allenshen13 commented Jan 14, 2026

Description

Add E2E tests for numeric_histogram aggregate function

Motivation and Context

Closes #26940

Impact

Test Plan

Ran aggregation tests locally and passed.

Contributor checklist

  • Please make sure your submission complies with our contributing guide, in particular code style and commit standards.
  • PR description addresses the issue accurately and concisely. If the change is non-trivial, a GitHub Issue is referenced.
  • Documented new properties (with its default value), SQL syntax, functions, or other functionality.
  • If release notes are required, they follow the release notes guidelines.
  • Adequate tests were added if applicable.
  • CI passed.
  • If adding new dependencies, verified they have an OpenSSF Scorecard score of 5.0 or higher (or obtained explicit TSC approval for lower scores).

Release Notes

Please follow release notes guidelines and fill in the release notes below.

== NO RELEASE NOTE ==

@allenshen13 allenshen13 requested review from a team as code owners January 14, 2026 19:03
@prestodb-ci prestodb-ci added the from:IBM PR from IBM label Jan 14, 2026
@prestodb-ci prestodb-ci requested review from a team, anandamideShakyan and pratyakshsharma and removed request for a team January 14, 2026 19:03
@sourcery-ai
Copy link
Copy Markdown
Contributor

sourcery-ai bot commented Jan 14, 2026

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Adds end-to-end native worker aggregation tests for the numeric_histogram aggregate function, covering both 2-argument and 3-argument forms and different numeric types.

File-Level Changes

Change Details Files
Add native aggregation E2E coverage for numeric_histogram with multiple signatures and value types.
  • Introduce a new test method that exercises numeric_histogram with (buckets, value) signature on lineitem.quantity, including grouped aggregation with orderkey.
  • Add assertions that numeric_histogram with (buckets, value, weight) signature runs successfully on quantity and extendedprice/quantity combinations, including grouped aggregation with orderkey.
  • Extend coverage to real-typed inputs by invoking numeric_histogram on tax_as_real with and without a weight parameter.
presto-native-execution/src/test/java/com/facebook/presto/nativeworker/AbstractTestNativeAggregations.java

Assessment against linked issues

Issue Objective Addressed Explanation
#26940 Add end-to-end tests for the numeric_histogram aggregate function.

Possibly linked issues

  • #(unassigned): PR implements the requested end-to-end tests for the numeric_histogram aggregate function variants mentioned in the issue.

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@github-actions
Copy link
Copy Markdown

github-actions bot commented Jan 14, 2026

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Snapshot Warnings

⚠️: No snapshots were found for the head SHA af26db6.
Ensure that dependencies are being submitted on PR branches. Re-running this action after a short time may resolve the issue. See the documentation for more information and troubleshooting advice.

Scanned Files

None

Copy link
Copy Markdown
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey - I've left some high level feedback:

  • These tests only check that the queries succeed; consider adding at least one assertion that validates the actual numeric_histogram output shape or key properties (e.g., bucket count, value ranges) to catch silent correctness regressions.
  • It may be worth adding a test case that covers boundary/edge conditions for numeric_histogram (e.g., zero or negative bucket counts, null values, or very skewed input) to ensure native execution matches the engine’s expected behavior in those cases.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- These tests only check that the queries succeed; consider adding at least one assertion that validates the actual `numeric_histogram` output shape or key properties (e.g., bucket count, value ranges) to catch silent correctness regressions.
- It may be worth adding a test case that covers boundary/edge conditions for `numeric_histogram` (e.g., zero or negative bucket counts, null values, or very skewed input) to ensure native execution matches the engine’s expected behavior in those cases.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@allenshen13 allenshen13 requested a review from jkhaliqi January 14, 2026 21:29
@allenshen13 allenshen13 force-pushed the add-aggregate-e2e-tests branch from 2bce613 to ebbd8e9 Compare January 15, 2026 00:56
Copy link
Copy Markdown
Contributor

@jkhaliqi jkhaliqi left a comment

Choose a reason for hiding this comment

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

Thanks for adding these tests!

@allenshen13 allenshen13 force-pushed the add-aggregate-e2e-tests branch from ebbd8e9 to 2e2c031 Compare March 12, 2026 22:50
@allenshen13 allenshen13 force-pushed the add-aggregate-e2e-tests branch from 2e2c031 to af26db6 Compare April 4, 2026 00:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

from:IBM PR from IBM

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add end to end tests for aggregate functions:

3 participants