Skip to content

feat: Add session property mark_distinct_spill_enabled (#27247)#27247

Merged
duxiao1212 merged 1 commit intoprestodb:masterfrom
duxiao1212:export-D94965529
Mar 16, 2026
Merged

feat: Add session property mark_distinct_spill_enabled (#27247)#27247
duxiao1212 merged 1 commit intoprestodb:masterfrom
duxiao1212:export-D94965529

Conversation

@duxiao1212
Copy link
Copy Markdown
Contributor

@duxiao1212 duxiao1212 commented Mar 2, 2026

Summary:

per title

Differential Revision: D94965529

== NO RELEASE NOTE ==

@duxiao1212 duxiao1212 requested review from a team, elharo and steveburnett as code owners March 2, 2026 23:13
@prestodb-ci prestodb-ci added the from:Meta PR from Meta label Mar 2, 2026
@sourcery-ai
Copy link
Copy Markdown
Contributor

sourcery-ai bot commented Mar 2, 2026

Reviewer's Guide

Adds a new native session property to control mark-distinct operator spilling, wires it through C++/Java configs, and extends tests/documentation mappings accordingly.

Class diagram for updated C++ SessionProperties with mark distinct spill property

classDiagram
    class SessionProperties {
        +SessionProperties()
        +void addSessionProperty(const char* name, const char* description, Type type, bool defaultValue, const char* configKey, const char* configValue)
        <<static>> const char* kRowNumberSpillEnabled
        <<static>> const char* kMarkDistinctSpillEnabled
        <<static>> const char* kSpillCompressionCodec
        <<static>> const char* kSpillerNumPartitionBits
    }

    class QueryConfig {
        <<static>> const char* kRowNumberSpillEnabled
        <<static>> const char* kMarkDistinctSpillEnabled
        +bool rowNumberSpillEnabled()
        +bool markDistinctSpillEnabled()
    }

    SessionProperties --> QueryConfig : uses
Loading

Class diagram for updated Java NativeWorkerSessionPropertyProvider with mark distinct spill property

classDiagram
    class NativeWorkerSessionPropertyProvider {
        +NativeWorkerSessionPropertyProvider(FeaturesConfig featuresConfig)
        <<static>> String NATIVE_WRITER_SPILL_ENABLED
        <<static>> String NATIVE_WRITER_FLUSH_THRESHOLD_BYTES
        <<static>> String NATIVE_ROW_NUMBER_SPILL_ENABLED
        <<static>> String NATIVE_MARK_DISTINCT_SPILL_ENABLED
        <<static>> String NATIVE_TOPN_ROW_NUMBER_SPILL_ENABLED
        <<static>> String NATIVE_SPILLER_NUM_PARTITION_BITS
        <<static>> String NATIVE_DEBUG_VALIDATE_OUTPUT_FROM_OPERATORS
        +PropertyMetadata booleanProperty(String name, String description, boolean defaultValue, boolean hidden)
    }

    class FeaturesConfig {
        +boolean isNativeExecutionEnabled()
    }

    NativeWorkerSessionPropertyProvider --> FeaturesConfig : reads nativeExecution
Loading

File-Level Changes

Change Details Files
Introduce native session property to enable/disable mark-distinct spilling in the native engine and wire it to query configuration.
  • Declare a new session property key for mark-distinct spilling in the native C++ SessionProperties header.
  • Register the new mark-distinct spilling property in the C++ SessionProperties constructor, mapping it to the corresponding QueryConfig flag with a default of false.
  • Expose the new native_mark_distinct_spill_enabled property in the Java NativeWorkerSessionPropertyProvider with description, default value, and gating on nativeExecution.
  • Extend SessionPropertiesTest mapping validation to cover the new mark-distinct spill session property and its QueryConfig mapping.
  • Prepare documentation hook in the native session properties docs file for the new property entry.
presto-native-execution/presto_cpp/main/SessionProperties.h
presto-native-execution/presto_cpp/main/SessionProperties.cpp
presto-main-base/src/main/java/com/facebook/presto/sessionpropertyproviders/NativeWorkerSessionPropertyProvider.java
presto-native-execution/presto_cpp/main/tests/SessionPropertiesTest.cpp
presto-docs/src/main/sphinx/presto_cpp/properties-session.rst

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 found 1 issue

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

## Individual Comments

### Comment 1
<location path="presto-docs/src/main/sphinx/presto_cpp/properties-session.rst" line_range="202" />
<code_context>
+* **Type:** ``boolean``
+* **Default value:** ``false``
+
+Native Execution only. Enable mark distinct spilling on native engine.
+
 ``native_simplified_expression_evaluation_enabled``
</code_context>
<issue_to_address>
**nitpick (typo):** Consider adding the article "the" in "on the native engine" for grammatical correctness.

You could rephrase the line to: “Native Execution only. Enable mark distinct spilling on the native engine.”

```suggestion
Native Execution only. Enable mark distinct spilling on the native engine.
```
</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.

Copy link
Copy Markdown
Contributor

@steveburnett steveburnett left a comment

Choose a reason for hiding this comment

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

LGTM! (docs)

Pull branch, local doc build, looks good. Thanks!

duxiao1212 added a commit to duxiao1212/presto that referenced this pull request Mar 9, 2026
Summary:

per title

Differential Revision: D94965529
duxiao1212 added a commit to duxiao1212/presto that referenced this pull request Mar 9, 2026
Summary:
Pull Request resolved: prestodb#27247

per title

Differential Revision: D94965529
@duxiao1212 duxiao1212 force-pushed the export-D94965529 branch 2 times, most recently from edacf24 to 9f42526 Compare March 12, 2026 22:40
duxiao1212 added a commit to duxiao1212/presto that referenced this pull request Mar 12, 2026
Summary:

per title

Differential Revision: D94965529
duxiao1212 added a commit to duxiao1212/presto that referenced this pull request Mar 12, 2026
Summary:
Pull Request resolved: prestodb#27247

per title

Differential Revision: D94965529
@meta-codesync meta-codesync bot changed the title feat: Add session property mark_distinct_spill_enabled feat: Add session property mark_distinct_spill_enabled (#27247) Mar 12, 2026
@steveburnett
Copy link
Copy Markdown
Contributor

Please add a release note following the Release Note Guidelines to pass the not required but failing CI check.

Look at the failures for the failing CI checks and see what you can do to resolve them.

Summary:

per title

Differential Revision: D94965529
Copy link
Copy Markdown
Member

@skyelves skyelves left a comment

Choose a reason for hiding this comment

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

LGTM

@duxiao1212 duxiao1212 merged commit f478024 into prestodb:master Mar 16, 2026
147 of 151 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants