Skip to content

Conversation

@konjac-h
Copy link
Contributor

Description

Motivation and Context

Impact

Test Plan

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.

== RELEASE NOTES ==

General Changes
* ... 
* ... 

Hive Connector Changes
* ... 
* ... 

If release note is NOT required, use:

== NO RELEASE NOTE ==
@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Oct 27, 2025

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Introduce an optional split-level cacheability flag and propagate it throughout existing scheduling components by combining connector-provided hints with node-level cacheability information to enable dynamic data caching at runtime.

Sequence diagram for dynamic cacheability assignment during split placement

sequenceDiagram
participant "Split"
participant "ConnectorSplit"
participant "NodeInfo"
participant "SplitContext"

Split->>ConnectorSplit: isCacheable()
ConnectorSplit-->>Split: Optional<Boolean>
Split->>NodeInfo: isCacheable()
NodeInfo-->>Split: Boolean
Split->>SplitContext: new SplitContext(cacheable)
SplitContext-->>Split: SplitContext instance
Loading

Class diagram for updated ConnectorSplit interface and SplitContext usage

classDiagram
class ConnectorSplit {
  +Optional<Boolean> isCacheable()
  +SplitWeight getSplitWeight()
}
class Split {
  +ConnectorId connectorId
  +TransactionHandle transactionHandle
  +ConnectorSplit connectorSplit
  +Lifespan lifespan
  +SplitContext splitContext
}
class SplitContext {
  +boolean cacheable
}
ConnectorSplit <|.. Split : uses
Split o-- SplitContext : has
Loading

Class diagram for NodeScheduler cacheability logic update

classDiagram
class NodeScheduler {
  +selectDistributionNodes(...)
}
class Split {
  +ConnectorSplit connectorSplit
}
class BucketNodeMap {
  +isSplitCacheable(Split split)
}
NodeScheduler o-- Split : uses
NodeScheduler o-- BucketNodeMap : uses
Split o-- ConnectorSplit : has
Loading

File-Level Changes

Change Details Files
Add optional split-level cacheability API to ConnectorSplit
  • Introduce default Optional isCacheable() method returning Optional.empty()
presto-spi/src/main/java/com/facebook/presto/spi/ConnectorSplit.java
Combine split-level and node-level cache hints in SimpleNodeSelector and SimpleTtlNodeSelector
  • Compute cacheable as split.getConnectorSplit().isCacheable().orElse(true) && nodeInfo.isCacheable()
  • Pass combined cacheable flag to SplitContext
presto-main-base/src/main/java/com/facebook/presto/execution/scheduler/nodeSelection/SimpleNodeSelector.java
presto-main-base/src/main/java/com/facebook/presto/execution/scheduler/nodeSelection/SimpleTtlNodeSelector.java
Incorporate split-level cacheability in NodeScheduler.selectDistributionNodes
  • Change isCacheable to split.getConnectorSplit().isCacheable().orElse(true) && bucketNodeMap.isSplitCacheable(split)
presto-main-base/src/main/java/com/facebook/presto/execution/scheduler/NodeScheduler.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

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

Labels

None yet

1 participant