Skip to content

chore: Refactor some of the scan and sink handling in CometExecRule to reduce duplicate code#2844

Merged
andygrove merged 16 commits intoapache:mainfrom
andygrove:refactor-op2proto
Dec 4, 2025
Merged

chore: Refactor some of the scan and sink handling in CometExecRule to reduce duplicate code#2844
andygrove merged 16 commits intoapache:mainfrom
andygrove:refactor-op2proto

Conversation

@andygrove
Copy link
Member

@andygrove andygrove commented Dec 3, 2025

Which issue does this PR close?

Closes #.

Rationale for this change

Make code easier to comprehend and remove some duplicate code.

What changes are included in this PR?

  • No functional changes
  • Most uses of CometExecRule.operator2Proto are removed and the serde framework is used instead. There is a follow up PR chore: Refactor CometExecRule handling of exchanges [WIP] #2848 to completely remove this method.
  • New serde implementations added (to existing classes in some cases):
    • CometExchangeSink
    • CometSparkToColumnarExec
    • CometScanWrapper

How are these changes tested?

@andygrove andygrove changed the title chore: Refactor some of the sink handling in CometExecRule to remove duplicate code chore: Refactor some of the scan and sink handling in CometExecRule to reduce duplicate code Dec 3, 2025
*/
private def operator2Proto(op: SparkPlan, childOp: Operator*): Option[Operator] = {

def isCometSink(op: SparkPlan): Boolean = {
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 method was moved and and modified to remove the check for isCometScan since scans are no longer handled in this code

}
}

def isExchangeSink(op: SparkPlan): Boolean = {
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 method was moved without modification

@codecov-commenter
Copy link

codecov-commenter commented Dec 3, 2025

Codecov Report

❌ Patch coverage is 74.19355% with 16 lines in your changes missing coverage. Please review.
✅ Project coverage is 59.14%. Comparing base (f09f8af) to head (9e0d127).
⚠️ Report is 734 commits behind head on main.

Files with missing lines Patch % Lines
...n/scala/org/apache/comet/rules/CometExecRule.scala 70.37% 10 Missing and 6 partials ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #2844      +/-   ##
============================================
+ 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 marked this pull request as ready for review December 3, 2025 22:52
Copy link
Contributor

@mbutrovich mbutrovich left a comment

Choose a reason for hiding this comment

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

Nice cleanup, @andygrove! Thank you! Approved pending CI.

@andygrove andygrove merged commit ad17997 into apache:main Dec 4, 2025
115 checks passed
@andygrove andygrove deleted the refactor-op2proto branch December 4, 2025 18:56
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