Skip to content

test: Add unit tests for expression (#15456)#26577

Open
ericyuliu wants to merge 1 commit into
prestodb:masterfrom
ericyuliu:export-D86727194
Open

test: Add unit tests for expression (#15456)#26577
ericyuliu wants to merge 1 commit into
prestodb:masterfrom
ericyuliu:export-D86727194

Conversation

@ericyuliu
Copy link
Copy Markdown
Contributor

Summary: Pull Request resolved: facebookincubator/velox#15456

Differential Revision: D86727194

Summary: Pull Request resolved: facebookincubator/velox#15456

Differential Revision: D86727194
@ericyuliu ericyuliu requested review from a team as code owners November 11, 2025 02:12
@sourcery-ai
Copy link
Copy Markdown
Contributor

sourcery-ai Bot commented Nov 11, 2025

Reviewer's Guide

Adds a new unit test for verifying JSON-to-RowExpression conversion of nested logical expressions (OR of an AND and an equality), ensuring the converter correctly builds the Velox expression tree.

File-Level Changes

Change Details Files
Introduce nestedOrAnd unit test to RowExpressionTest.
  • Define a JSON string representing an OR combining an AND and an EQUAL call
  • Parse JSON into protocol::RowExpression and convert to Velox expression
  • Assert top-level expression is an OR call with BOOLEAN type
  • Verify the first child is an AND call and inspect its GREATER_THAN and LESS_THAN inputs
  • Verify the second child is an EQUAL call and check its variable and constant inputs
presto-native-execution/presto_cpp/main/types/tests/RowExpressionTest.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

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 there - I've reviewed your changes - here's some feedback:

  • The nestedOrAnd test is very verbose and would benefit from helper functions to remove duplication when validating CallTypedExpr structures.
  • Embedding such a large raw JSON string makes the test fragile; consider using builder APIs or an external fixture to construct test expressions more clearly.
  • Consider splitting this long test into smaller, focused cases (e.g., separate AND and OR tests) to isolate failures and improve readability.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The nestedOrAnd test is very verbose and would benefit from helper functions to remove duplication when validating CallTypedExpr structures.
- Embedding such a large raw JSON string makes the test fragile; consider using builder APIs or an external fixture to construct test expressions more clearly.
- Consider splitting this long test into smaller, focused cases (e.g., separate AND and OR tests) to isolate failures and improve readability.

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.

@steveburnett
Copy link
Copy Markdown
Contributor

While not required to merge, please fix the Release Notes section of the PR Description to pass the failing test.
https://github.com/prestodb/presto/actions/runs/19252646512/job/55040553051?pr=26577

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.

3 participants