Skip to content

fix(native): Remove key_sampling_percent from native Sql invoked functions and Advance velox#27210

Draft
pramodsatya wants to merge 1 commit intoprestodb:masterfrom
pramodsatya:fix_key_sampling_percent
Draft

fix(native): Remove key_sampling_percent from native Sql invoked functions and Advance velox#27210
pramodsatya wants to merge 1 commit intoprestodb:masterfrom
pramodsatya:fix_key_sampling_percent

Conversation

@pramodsatya
Copy link
Contributor

@pramodsatya pramodsatya commented Feb 26, 2026

Description

key_sampling_percent is now a built-in function in Velox (ref: facebookincubator/velox#16113), it should no longer be registered as a native sql invoked function.

Motivation and Context

Fixes tests error seen during submodule update:

[2026-02-25T09:45:52.123Z] Caused by: java.lang.RuntimeException: line 1:8: Function 'native.default.key_sampling_percent' has two matching signatures. Please specify parameter types. 
[2026-02-25T09:45:52.123Z] First match : 'native.default.key_sampling_percent(varchar):double', Second match: 'native.default.key_sampling_percent(varchar):double'

The same error also appears to have impacted #27193.

== NO RELEASE NOTE ==

Summary by Sourcery

Remove the deprecated native SQL-invoked implementation of key_sampling_percent and advance the Velox submodule to rely on its built-in function instead.

Bug Fixes:

  • Resolve duplicate key_sampling_percent function registration by dropping its native SQL-invoked implementation.

Enhancements:

  • Clean up native SQL-invoked function registrations by removing the obsolete NativeSimpleSamplingPercent class.

@pramodsatya pramodsatya requested review from a team as code owners February 26, 2026 01:10
@prestodb-ci prestodb-ci added the from:IBM PR from IBM label Feb 26, 2026
@prestodb-ci prestodb-ci requested a review from a team February 26, 2026 01:10
@pramodsatya pramodsatya changed the title fix(native): Remote key_sampling_percent from native Sql invoked functions and Advance velox fix(native): Remove key_sampling_percent from native Sql invoked functions and Advance velox Feb 26, 2026
@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Feb 26, 2026

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Removes the native SQL-invoked implementation of key_sampling_percent now that it is built into Velox, and advances the Velox submodule accordingly to avoid duplicate function registration and signature conflicts.

Class diagram for updated native SQL-invoked functions plugin

classDiagram
    class NativeSqlInvokedFunctionsPlugin {
        +Set~Class~ getSqlInvokedFunctions()
    }

    class NativeArraySqlFunctions
    class NativeMapSqlFunctions
    %% NativeSimpleSamplingPercent has been removed and is no longer registered

    NativeSqlInvokedFunctionsPlugin ..> NativeArraySqlFunctions : registers
    NativeSqlInvokedFunctionsPlugin ..> NativeMapSqlFunctions : registers
Loading

File-Level Changes

Change Details Files
Stop registering key_sampling_percent as a native SQL-invoked function now that it exists as a built-in Velox function.
  • Remove NativeSimpleSamplingPercent from the set of SQL-invoked function classes returned by the native SQL invoked functions plugin.
  • Delete the NativeSimpleSamplingPercent implementation class to prevent duplicate function definitions and signature collisions.
  • Advance the presto-native-execution/velox submodule pointer to a version where key_sampling_percent is available as a built-in function.
presto-sql-helpers/presto-native-sql-invoked-functions-plugin/src/main/java/com/facebook/presto/scalar/sql/NativeSqlInvokedFunctionsPlugin.java
presto-sql-helpers/presto-native-sql-invoked-functions-plugin/src/main/java/com/facebook/presto/scalar/sql/NativeSimpleSamplingPercent.java
presto-native-execution/velox

Possibly linked issues

  • #Unknown: PR removes duplicate key_sampling_percent native registration introduced with Velox update, resolving the remote function test crashes described.

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

@pramodsatya pramodsatya marked this pull request as draft February 26, 2026 02:07
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.

2 participants