Skip to content

Conversation

@andygrove
Copy link
Member

@andygrove andygrove commented Dec 4, 2025

Which issue does this PR close?

N/A

Rationale for this change

Similar to the effort of creating the serde framework in Scala, this PR starts a similar process for the native planning code. We currently have >4k LOC in planner.rs for handling all supported operations and expressions and this PR introduces a framework to allow us to start moving code into separate files.

What changes are included in this PR?

  • New ExpressionRegistry
  • New ExpressionType enum and ExpressionBuilder trait
  • Move arithmetic, comparison, logical, bitwise, and null check expressions to the new framework
  • Implement macros to make the above expressions more concise since they are extremely repetitive and consistent patterns

How are these changes tested?

@codecov-commenter
Copy link

codecov-commenter commented Dec 4, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 59.14%. Comparing base (f09f8af) to head (86685dc).
⚠️ Report is 739 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #2851      +/-   ##
============================================
+ Coverage     56.12%   59.14%   +3.01%     
- Complexity      976     1471     +495     
============================================
  Files           119      167      +48     
  Lines         11743    15235    +3492     
  Branches       2251     2513     +262     
============================================
+ Hits           6591     9010    +2419     
- Misses         4012     4942     +930     
- Partials       1140     1283     +143     

☔ View full report in Codecov by Sentry.
📢 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.

@andygrove andygrove changed the title feat: Add expression registry to native planner [WIP] feat: Add expression registry to native planner Dec 4, 2025
@andygrove andygrove marked this pull request as ready for review December 4, 2025 23:51
@andygrove andygrove marked this pull request as draft December 5, 2025 14:01
@andygrove andygrove marked this pull request as ready for review December 5, 2025 14:03
Comment on lines +248 to +251
// Try to use the modular registry first - this automatically handles any registered expression types
if ExpressionRegistry::global().can_handle(spark_expr) {
return ExpressionRegistry::global().create_expr(spark_expr, input_schema, self);
}
Copy link
Member Author

Choose a reason for hiding this comment

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

This is the main change in the planner

@comphead
Copy link
Contributor

comphead commented Dec 6, 2025

Awesome, this would be much more helpful and also starting to addresses some concerns raised by @rluvaton in #2825

@parthchandra
Copy link
Contributor

Should we update the developer guide as part of this?

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.

4 participants