Skip to content

chore(native): Cleanup expression optimizer API#26925

Merged
pramodsatya merged 1 commit intoprestodb:masterfrom
pramodsatya:expr_opt_clnup
Jan 9, 2026
Merged

chore(native): Cleanup expression optimizer API#26925
pramodsatya merged 1 commit intoprestodb:masterfrom
pramodsatya:expr_opt_clnup

Conversation

@pramodsatya
Copy link
Copy Markdown
Contributor

Description

Removes unused parameter timezone from ExprOptimizer::optimizeExpressions() API.

Motivation and Context

This parameter was used in the initial implementation, and is no longer required since the queryCtx contains this info.

Impact

NA

Test Plan

Verified with e2e tests.

== NO RELEASE NOTE ==

Copilot AI review requested due to automatic review settings January 8, 2026 20:44
@pramodsatya pramodsatya requested review from a team as code owners January 8, 2026 20:44
@prestodb-ci prestodb-ci added the from:IBM PR from IBM label Jan 8, 2026
@prestodb-ci prestodb-ci requested review from a team, imjalpreet and namya28 and removed request for a team and Copilot January 8, 2026 20:44
@sourcery-ai
Copy link
Copy Markdown
Contributor

sourcery-ai bot commented Jan 8, 2026

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Removes the unused timezone parameter from the expression optimizer API and its call sites, updating the documentation/comments accordingly while leaving behavior unchanged.

Class diagram for updated ExpressionOptimizer API

classDiagram
    class ExpressionOptimizerNamespace {
      <<namespace>>
      +optimizeExpressions(input : vector~RowExpressionPtr~, optimizerLevel : OptimizerLevel&, queryCtx : velox::core::QueryCtx*, pool : velox::memory::MemoryPool*) vector~protocol::RowExpressionOptimizationResult~
    }

    class PrestoServer {
      +getOptimizedExpressions(expressions : vector~RowExpressionPtr~, timezone : string, optimizerLevel : OptimizerLevel, queryCtx : shared_ptr~velox::core::QueryCtx~, pool : velox::memory::MemoryPool*) json::array_t
    }

    PrestoServer ..> ExpressionOptimizerNamespace : calls optimizeExpressions

    class OptimizerLevel {
      <<enum>>
      OPTIMIZED
      EVALUATED
    }
Loading

File-Level Changes

Change Details Files
Simplified ExpressionOptimizer API by dropping the unused timezone parameter and updating its documentation.
  • Updated optimizeExpressions declaration to remove the timezone parameter from the function signature.
  • Adjusted Doxygen-style comments to drop the timezone param description and clarify the OPTIMIZED and EVALUATED behavior using the Velox ExprOptimizer.
  • Updated the optimizeExpressions definition to match the new signature without timezone.
presto-native-execution/presto_cpp/main/types/ExpressionOptimizer.h
presto-native-execution/presto_cpp/main/types/ExpressionOptimizer.cpp
Updated PrestoServer usage of optimizeExpressions to match the new API signature without timezone.
  • Removed timezone from the optimizeExpressions call in getOptimizedExpressions, passing only expressions, optimizerLevel, queryCtx, and pool.
presto-native-execution/presto_cpp/main/PrestoServer.cpp

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

@pramodsatya
Copy link
Copy Markdown
Contributor Author

@aditi-pandit, @amitkdutta, could you please help review this API cleanup?

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

@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 @pramodsatya

@pramodsatya pramodsatya merged commit 04bcfef into prestodb:master Jan 9, 2026
117 of 123 checks passed
@pramodsatya pramodsatya deleted the expr_opt_clnup branch January 9, 2026 20:12
tdcmeehan pushed a commit to rdtr/presto that referenced this pull request Jan 14, 2026
## Description
Removes unused parameter `timezone` from
`ExprOptimizer::optimizeExpressions()` API.

## Motivation and Context
This parameter was used in the initial implementation, and is no longer
required since the `queryCtx` contains this info.

## Impact
NA

## Test Plan
Verified with e2e tests.


```
== NO RELEASE NOTE ==
```
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.

3 participants