Skip to content

Conversation

@yjyolandeyan
Copy link
Contributor

@yjyolandeyan yjyolandeyan commented Nov 11, 2025

as titled

Description

add java session property max_split_preload_per_driver with default value 0

Motivation and Context

enable feature waitForPreloadSplitNanos

Impact

Test Plan

[e2e]
20251106_193157_00009_runst: waitForPreloadSplitNanos enabled when max_split_preload_per_driver = 2
20251105_230547_00023_gy8x9: waitForPreloadSplitNanos disabled when max_split_preload_per_driver = 0 (default)

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

@yjyolandeyan yjyolandeyan requested a review from a team as a code owner November 11, 2025 22:43
@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Nov 11, 2025

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Introduce a new Java session property max_split_preload_per_driver by defining its constant, registering it with a default value, and providing an accessor method.

Class diagram for updated SystemSessionProperties with max_split_preload_per_driver

classDiagram
    class SystemSessionProperties {
        +static final String MAX_SPLIT_PRELOAD_PER_DRIVER
        +int getMaxSplitPreloadPerDriver(Session session)
    }
    SystemSessionProperties --> Session : uses
Loading

File-Level Changes

Change Details Files
Define new session property constant
  • Add public static final String for MAX_SPLIT_PRELOAD_PER_DRIVER
presto-main-base/src/main/java/com/facebook/presto/SystemSessionProperties.java
Register session property in constructor
  • Insert integerProperty call with name, description, default 0, and hidden=false
presto-main-base/src/main/java/com/facebook/presto/SystemSessionProperties.java
Add accessor method for the property
  • Implement getMaxSplitPreloadPerDriver(Session) returning the system property
presto-main-base/src/main/java/com/facebook/presto/SystemSessionProperties.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
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 there - I've reviewed your changes and they look great!

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location> `presto-main-base/src/main/java/com/facebook/presto/SystemSessionProperties.java:194` </location>
<code_context>
     public static final String IGNORE_STATS_CALCULATOR_FAILURES = "ignore_stats_calculator_failures";
     public static final String PRINT_STATS_FOR_NON_JOIN_QUERY = "print_stats_for_non_join_query";
     public static final String MAX_DRIVERS_PER_TASK = "max_drivers_per_task";
+    public static final String MAX_SPLIT_PRELOAD_PER_DRIVER = "max_split_preload_per_driver";
     public static final String MAX_TASKS_PER_STAGE = "max_tasks_per_stage";
     public static final String DEFAULT_FILTER_FACTOR_ENABLED = "default_filter_factor_enabled";
</code_context>

<issue_to_address>
**suggestion:** Consider validating the value for MAX_SPLIT_PRELOAD_PER_DRIVER.

Please add a validation step for MAX_SPLIT_PRELOAD_PER_DRIVER to ensure its value is non-negative and within reasonable limits, similar to the approach used for MAX_DRIVERS_PER_TASK.

Suggested implementation:

```java
                integerProperty(
                        MAX_SPLIT_PRELOAD_PER_DRIVER,
                        "Maximum number of splits to preload per driver. Set to 0 to disable preloading",
                        0,
                        false,
                        value -> validateNullablePositiveIntegerValue(value, MAX_SPLIT_PRELOAD_PER_DRIVER),
                        object -> object),

```

If `validateNullablePositiveIntegerValue` is not already imported or available in this file, you will need to import or implement it. Also, ensure that the validation logic matches your requirements for "reasonable limits" (e.g., you may want to set an upper bound).
</issue_to_address>

### Comment 2
<location> `presto-main-base/src/main/java/com/facebook/presto/SystemSessionProperties.java:1030` </location>
<code_context>
                         object -> object),
+                integerProperty(
+                        MAX_SPLIT_PRELOAD_PER_DRIVER,
+                        "Maximum number of splits to preload per driver. Set to 0 to disable preloading",
+                        0,
+                        false),
</code_context>

<issue_to_address>
**suggestion:** Clarify behavior for negative values in the property description.

If negative values are invalid, please update the description to explicitly state this.

```suggestion
                        "Maximum number of splits to preload per driver. Must be zero or positive. Set to 0 to disable preloading. Negative values are not allowed.",
```
</issue_to_address>

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.

object -> object),
integerProperty(
MAX_SPLIT_PRELOAD_PER_DRIVER,
"Maximum number of splits to preload per driver. Set to 0 to disable preloading",
Copy link
Contributor

Choose a reason for hiding this comment

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

suggestion: Clarify behavior for negative values in the property description.

If negative values are invalid, please update the description to explicitly state this.

Suggested change
"Maximum number of splits to preload per driver. Set to 0 to disable preloading",
"Maximum number of splits to preload per driver. Must be zero or positive. Set to 0 to disable preloading. Negative values are not allowed.",

@kewang1024
Copy link
Collaborator

could you rename to session property? otherwise LGTM, thanks @yjyolandeyan !

@kewang1024 kewang1024 self-requested a review November 11, 2025 23:04
@steveburnett
Copy link
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants