Skip to content

Conversation

@ericyuliu
Copy link
Contributor

@ericyuliu ericyuliu commented Oct 23, 2025

== NO RELEASE NOTE ==

Summary:
X-link: facebookincubator/velox#15264

add more unit tests for expression

Differential Revision: D85356832

@ericyuliu ericyuliu requested review from a team as code owners October 23, 2025 17:42
@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Oct 23, 2025

Reviewer's Guide

This PR extends RowExpressionTest.cpp by adding new unit tests for boolean constants (false and null) and logical operators (OR and NOT), and refines formatting in existing tests for improved readability.

File-Level Changes

Change Details Files
Added unit tests for boolean constants
  • Introduced TEST_F RowExpressionTest.booleanFalse
  • Introduced TEST_F RowExpressionTest.booleanNull
presto-native-execution/presto_cpp/main/types/tests/RowExpressionTest.cpp
Added unit tests for special logical operators
  • Introduced TEST_F RowExpressionTest.specialOr covering OR form with nested calls
  • Introduced TEST_F RowExpressionTest.specialNot covering NOT operator with nested call
presto-native-execution/presto_cpp/main/types/tests/RowExpressionTest.cpp
Refactored existing test formatting
  • Split SystemConfig.setValue call across multiple lines
  • Reformatted dynamic_pointer_cast expressions onto separate lines
  • Condensed likeWithEscape assertion to a single line
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
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:

  • A lot of these JSON-based test cases follow the same structure—consider parameterizing the boolean constants (true/false/null) and the special call forms to reduce duplication and improve maintainability.
  • The large inline JSON literals make tests harder to read and evolve; think about introducing helper functions or builders for constructing expressions to keep tests concise.
  • Some test names (e.g. specialOr, specialNot) could be more descriptive or unified—consider aligning naming conventions so it’s clear these cover logical operators as opposed to generic “special” cases.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- A lot of these JSON-based test cases follow the same structure—consider parameterizing the boolean constants (true/false/null) and the special call forms to reduce duplication and improve maintainability.
- The large inline JSON literals make tests harder to read and evolve; think about introducing helper functions or builders for constructing expressions to keep tests concise.
- Some test names (e.g. specialOr, specialNot) could be more descriptive or unified—consider aligning naming conventions so it’s clear these cover logical operators as opposed to generic “special” cases.

## Individual Comments

### Comment 1
<location> `presto-native-execution/presto_cpp/main/types/tests/RowExpressionTest.cpp:444-445` </location>
<code_context>

 TEST_F(RowExpressionTest, char) {
-  SystemConfig::instance()->setValue(std::string(SystemConfig::kCharNToVarcharImplicitCast), "true");
+  SystemConfig::instance()->setValue(
+      std::string(SystemConfig::kCharNToVarcharImplicitCast), "true");
   std::string str = R"##(
         {
</code_context>

<issue_to_address>
**nitpick (testing):** Nitpick: Consider resetting SystemConfig after the test to avoid side effects.

Resetting SystemConfig after the test will prevent unintended interactions with other tests.
</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
Contributor

@bigfootjon bigfootjon left a comment

Choose a reason for hiding this comment

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

Review automatically exported from Phabricator review in Meta.

ericyuliu added a commit to ericyuliu/presto that referenced this pull request Oct 24, 2025
…o clean up of mapTypeKindToName (prestodb#26414)

Summary:

X-link: facebookincubator/velox#15264

add more unit tests for expression

Reviewed By: bigfootjon

Differential Revision: D85356832
Summary:
add more unit tests for expression

X-link: facebookincubator/velox#15264

Reviewed By: bigfootjon

Differential Revision: D85356832

Pulled By: ericyuliu
@xiaoxmeng xiaoxmeng merged commit ee5e263 into prestodb:master Oct 28, 2025
81 checks passed
meta-codesync bot pushed a commit to facebookincubator/velox that referenced this pull request Oct 30, 2025
Summary:
X-link: prestodb/presto#26414

 add more unit tests for expression

Pull Request resolved: #15264

Test Plan: unit tests passed

Reviewed By: bigfootjon, xiaoxmeng

Differential Revision: D85356832

Pulled By: ericyuliu

fbshipit-source-id: ed571b79c02ac3093f621903e91490530365ef8f
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