Skip to content

fix: make Unsupported require a reason string#3885

Draft
andygrove wants to merge 1 commit intoapache:mainfrom
andygrove:fix-generate-empty-fallback-reason
Draft

fix: make Unsupported require a reason string#3885
andygrove wants to merge 1 commit intoapache:mainfrom
andygrove:fix-generate-empty-fallback-reason

Conversation

@andygrove
Copy link
Copy Markdown
Member

@andygrove andygrove commented Apr 2, 2026

Which issue does this PR close?

N/A (minor bug fix discovered during plan inspection)

Rationale for this change

The Unsupported case class uses Option[String] for its notes field, which allows constructing Unsupported() or Unsupported(None) without a reason. When this happens, the explain output shows empty fallback messages like Generate [COMET: ] which are not helpful for debugging why an operator was not converted.

What changes are included in this PR?

  • Changed Unsupported from case class Unsupported(notes: Option[String] = None) to case class Unsupported(notes: String), making a reason string required at compile time.
  • Removed Some(...) wrapping from all existing Unsupported(Some("...")) call sites.
  • Replaced notes.getOrElse("") with notes at the three match sites that consume the value.
  • Added reason strings to the two call sites that previously used Unsupported() without a reason: CometShuffleExchangeExec and CometArrayFilter.

How are these changes tested?

This is a mechanical refactor that makes the type system enforce non-empty reasons. The existing test suite covers operator conversion logic. Verified the change compiles and passes spotless formatting.

@andygrove andygrove force-pushed the fix-generate-empty-fallback-reason branch from 97eecf4 to 40478e3 Compare April 2, 2026 20:02
@andygrove andygrove changed the title fix: provide fallback reasons for Generate and ArrayFilter operators fix: provide fallback reason for ArrayFilter Apr 2, 2026
Change Unsupported case class from Option[String] to String to prevent
empty fallback reasons in explain output. This ensures every unsupported
feature has a descriptive message explaining why it is not supported.
@andygrove andygrove force-pushed the fix-generate-empty-fallback-reason branch from 40478e3 to 9186e25 Compare April 2, 2026 20:07
@andygrove andygrove changed the title fix: provide fallback reason for ArrayFilter fix: make Unsupported require a reason string Apr 2, 2026
Comment on lines +625 to +626
case _ =>
Unsupported("Only array_compact (ArrayFilter with IsNotNull) is supported")
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.

This was previously not reported

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.

1 participant