Skip to content

test: Add end to end test for key_sampling_percent#27025

Merged
jkhaliqi merged 1 commit intoprestodb:masterfrom
jkhaliqi:key_sampling_percent
Mar 11, 2026
Merged

test: Add end to end test for key_sampling_percent#27025
jkhaliqi merged 1 commit intoprestodb:masterfrom
jkhaliqi:key_sampling_percent

Conversation

@jkhaliqi
Copy link
Copy Markdown
Contributor

@jkhaliqi jkhaliqi commented Jan 23, 2026

Description

Add E2E tests for key_sampling_percent

Motivation and Context

As part of testing for facebookincubator/velox#16041

Impact

Test Plan

Added in E2E tests

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).

Summary by Sourcery

Tests:

  • Extend native string function E2E tests to validate key_sampling_percent using a variety of VARCHAR inputs.

Release Notes

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

== NO RELEASE NOTE ==

@jkhaliqi jkhaliqi requested review from a team as code owners January 23, 2026 19:01
@prestodb-ci prestodb-ci added the from:IBM PR from IBM label Jan 23, 2026
@prestodb-ci prestodb-ci requested review from a team, bibith4 and pramodsatya and removed request for a team January 23, 2026 19:01
@sourcery-ai
Copy link
Copy Markdown
Contributor

sourcery-ai bot commented Jan 23, 2026

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Adds an end-to-end native worker test coverage for the key_sampling_percent string function by extending the existing string functions test to create a temp table, populate it with a variety of VARCHAR values (including NULL and edge cases), and assert that key_sampling_percent executes successfully in native execution.

File-Level Changes

Change Details Files
Extend native string function E2E tests to cover key_sampling_percent on a temp VARCHAR table with diverse values.
  • Update the string functions test comment to reflect coverage of normalize and key_sampling_percent.
  • After existing normalize() assertions, insert a variety of VARCHAR values (including NULL, short/long strings, numeric-like content, special characters, whitespace-only, and empty string) into a temporary table.
  • Add an assertQuery invocation that runs key_sampling_percent(c0) on the populated temp table to validate native execution behavior.
  • Preserve table cleanup via dropTableIfExists in the finally block.
presto-native-execution/src/test/java/com/facebook/presto/nativeworker/AbstractTestNativeGeneralQueries.java

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

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 reviewed your changes and they look great!


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.

Copy link
Copy Markdown
Contributor

@pramodsatya pramodsatya left a comment

Choose a reason for hiding this comment

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

Thanks @jkhaliqi.

@jkhaliqi jkhaliqi force-pushed the key_sampling_percent branch 2 times, most recently from c93b64d to ab760b3 Compare February 4, 2026 21:31
@jkhaliqi jkhaliqi force-pushed the key_sampling_percent branch from ab760b3 to a324e43 Compare February 6, 2026 21:04
@jkhaliqi jkhaliqi force-pushed the key_sampling_percent branch from a324e43 to 5a17663 Compare February 18, 2026 16:49
@jkhaliqi
Copy link
Copy Markdown
Contributor Author

Tests related to key_sampling_percent on CI will pass once velox PR is in presto.

Copy link
Copy Markdown
Contributor

@aditi-pandit aditi-pandit left a comment

Choose a reason for hiding this comment

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

Thanks @jkhaliqi

Copy link
Copy Markdown
Contributor

@aditi-pandit aditi-pandit left a comment

Choose a reason for hiding this comment

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

@jkhaliqi : Do you get consistent results between Prestissimo and Java for this ? I feel we should be fine with just assertQuerySucceeds here.

@jkhaliqi
Copy link
Copy Markdown
Contributor Author

jkhaliqi commented Mar 9, 2026

@aditi-pandit E2E tests in place were passing with same results.

@jkhaliqi jkhaliqi force-pushed the key_sampling_percent branch from 5a17663 to c6f0681 Compare March 9, 2026 15:40
Copy link
Copy Markdown
Contributor

@aditi-pandit aditi-pandit left a comment

Choose a reason for hiding this comment

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

Thanks @jkhaliqi

@jkhaliqi jkhaliqi force-pushed the key_sampling_percent branch from c6f0681 to 329246a Compare March 11, 2026 13:23
@jkhaliqi jkhaliqi merged commit 4a4d1e9 into prestodb:master Mar 11, 2026
82 checks passed
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.

5 participants