Skip to content

Conversation

andygrove
Copy link
Member

@andygrove andygrove commented Aug 26, 2025

Which issue does this PR close?

Part of #2239

Part of #1974

Rationale for this change

We currently have two different approaches to expression fallback reporting.

  • CometCast has different support levels Compatible, Incompatible, and Unsupported which are context sensitive (different types of cast have different support levels)
  • Other expressions have IncompatExpr

This PR is a step towards unifying these approaches.

What changes are included in this PR?

  • Remove IncompatExpr trait
  • Add getSupportLevel method to CometExpressionSerde

How are these changes tested?

@andygrove andygrove changed the title Support level chore: Improve expression fallback reporting Aug 26, 2025
@codecov-commenter
Copy link

codecov-commenter commented Aug 26, 2025

Codecov Report

❌ Patch coverage is 58.69565% with 19 lines in your changes missing coverage. Please review.
✅ Project coverage is 58.51%. Comparing base (f09f8af) to head (7ef3abf).
⚠️ Report is 412 commits behind head on main.

Files with missing lines Patch % Lines
.../scala/org/apache/comet/serde/QueryPlanSerde.scala 20.83% 14 Missing and 5 partials ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #2240      +/-   ##
============================================
+ Coverage     56.12%   58.51%   +2.38%     
- Complexity      976     1281     +305     
============================================
  Files           119      143      +24     
  Lines         11743    13280    +1537     
  Branches       2251     2369     +118     
============================================
+ Hits           6591     7771    +1180     
- Misses         4012     4272     +260     
- Partials       1140     1237      +97     

☔ 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 August 26, 2025 18:13
Comment on lines -25 to -33

/** We support this feature with full compatibility with Spark */
case class Compatible(notes: Option[String] = None) extends SupportLevel

/** We support this feature but results can be different from Spark */
case class Incompatible(notes: Option[String] = None) extends SupportLevel

/** We do not support this feature */
object Unsupported extends SupportLevel
Copy link
Member Author

Choose a reason for hiding this comment

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

These move into QueryPlanSerde now that they are no longer specific to Cast

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.

LGTM, a couple of minor questions that don't require change:

  • Should we prefer "Comet" over "we" in comments?
  • Do we have an example of what kind of notes would be put in Compatible?

@andygrove
Copy link
Member Author

* Should we prefer "Comet" over "we" in comments?

Yes, I can update this in the next PR (#2211)

* Do we have an example of what kind of notes would be put in `Compatible`?

We only have one example of this so far, when casting from String to Date:

Compatible(Some("Only supports years between 262143 BC and 262142 AD"))

So really, when we say "Compatible", we mean Compatible enough that we are willing to allow it by default.

@andygrove andygrove merged commit 528822a into apache:main Aug 26, 2025
95 checks passed
@andygrove
Copy link
Member Author

Thanks for the review @mbutrovich

@andygrove andygrove deleted the support-level branch August 26, 2025 19:09
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