Skip to content

feat: Improve fallback reporting for native_datafusion scan#2879

Merged
mbutrovich merged 10 commits into
apache:mainfrom
andygrove:refactor-native-datafusion-checks
Dec 12, 2025
Merged

feat: Improve fallback reporting for native_datafusion scan#2879
mbutrovich merged 10 commits into
apache:mainfrom
andygrove:refactor-native-datafusion-checks

Conversation

@andygrove
Copy link
Copy Markdown
Member

@andygrove andygrove commented Dec 11, 2025

Which issue does this PR close?

N/A

We should merge #2877 before this one

Rationale for this change

Move native_datafusion checks into CometNativeScan and improve fallback reporting. The current implementation does not report all fallback reasons because the code returns on hitting the first fallback reason.

What changes are included in this PR?

  • Move the validation logic to CometNativeScan
  • Rather than building a list of fallback reasons, just tag the plan with each fallback reason

How are these changes tested?

Existing tests


if (encryptionEnabled(hadoopConf) && scanImpl != CometConf.SCAN_NATIVE_COMET) {
if (!isEncryptionConfigSupported(hadoopConf)) {
return withInfos(scanExec, fallbackReasons.toSet)
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

It looks like fallbackReasons was always an empty set here?

@andygrove andygrove changed the title minor: Refactor checks for native_datafusion scan feat: Improve fallback reporting for native_datafusion scan Dec 11, 2025
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Dec 11, 2025

Codecov Report

❌ Patch coverage is 68.29268% with 13 lines in your changes missing coverage. Please review.
✅ Project coverage is 59.40%. Comparing base (f09f8af) to head (48116a7).
⚠️ Report is 1095 commits behind head on main.

Files with missing lines Patch % Lines
.../apache/comet/serde/operator/CometNativeScan.scala 61.90% 3 Missing and 5 partials ⚠️
...n/scala/org/apache/comet/rules/CometScanRule.scala 75.00% 4 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #2879      +/-   ##
============================================
+ Coverage     56.12%   59.40%   +3.27%     
- Complexity      976     1374     +398     
============================================
  Files           119      167      +48     
  Lines         11743    15337    +3594     
  Branches       2251     2549     +298     
============================================
+ Hits           6591     9111    +2520     
- Misses         4012     4939     +927     
- Partials       1140     1287     +147     

☔ 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 11, 2025 21:04

scanExec.relation match {
case r: HadoopFsRelation =>
val fallbackReasons = new ListBuffer[String]()
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

The code no longer accumulates fallback reasons in a list, but just calls withInfo for each fallback so that we accumulate them directly on the operator.

}

// Native DataFusion doesn't support subqueries/dynamic pruning
if (scanImpl == SCAN_NATIVE_DATAFUSION &&
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

All of the checks for native_datafusion have moved into CometNativeScan.isSupported(scanExec).

Copy link
Copy Markdown
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.

We looked at this together earlier, LGTM! Thanks @andygrove!

@mbutrovich mbutrovich merged commit 24e4c12 into apache:main Dec 12, 2025
113 checks passed
@andygrove andygrove deleted the refactor-native-datafusion-checks branch December 12, 2025 01:32
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