Skip to content

Refactoring: Merge the IN expression variants into Expr::In - #2679

Open
LucaCappelletti94 wants to merge 2 commits into
mainfrom
in-expr-refactor
Open

LucaCappelletti94 wants to merge 2 commits into
mainfrom
in-expr-refactor

Conversation

@LucaCappelletti94

Copy link
Copy Markdown
Contributor

Expr had three variants for the IN predicate, InList, InSubquery and InUnnest, each repeating the left-hand expression and the NOT flag, two of them repeating ClickHouse's GLOBAL flag, and each with its own copy of the Display, Spanned and parser code. Supporting another right-hand side, such as SQLite's IN table_name, meant a fourth copy.

They are now one Expr::In { expr, target, negated, global }, where target is an InTarget: List, Subquery or Unnest. The SQL that parses and the text printed back are unchanged, GLOBAL is still only accepted before a list or subquery, and size_of::<Expr>() stays at 328 bytes. This is a breaking change for code that builds or matches Expr::InList, Expr::InSubquery or Expr::InUnnest, which now match Expr::In with the corresponding InTarget.

@codecov-commenter

codecov-commenter commented Oct 18, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.34%. Comparing base (3330dc9) to head (358a424).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2679      +/-   ##
==========================================
+ Coverage   81.31%   81.34%   +0.03%     
==========================================
  Files          42       42              
  Lines       33977    33984       +7     
  Branches    33977    33984       +7     
==========================================
+ Hits        27628    27645      +17     
+ Misses       2785     2775      -10     
  Partials     3564     3564              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@alamb alamb left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

look like a nice cleanup to me

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.

4 participants