Skip to content

chore: fix spark ansi sum incompatibility message#4111

Open
coderfender wants to merge 14 commits into
apache:mainfrom
coderfender:fix_comet_sum_compatbility_level
Open

chore: fix spark ansi sum incompatibility message#4111
coderfender wants to merge 14 commits into
apache:mainfrom
coderfender:fix_comet_sum_compatbility_level

Conversation

@coderfender
Copy link
Copy Markdown
Contributor

@coderfender coderfender commented Apr 27, 2026

Which issue does this PR close?

Closes #4074

  1. CometSum: removed the misleading ANSI-mode incompatibility message (since we do support ANSI mode)
  2. CometFromUnixTime`: getSupportLevel now distinguishes based on default date pattern

Rationale for this change

What changes are included in this PR?

How are these changes tested?

Comment thread spark/src/main/scala/org/apache/comet/serde/strings.scala Outdated
Comment thread spark/src/main/scala/org/apache/comet/serde/unixtime.scala
@coderfender coderfender force-pushed the fix_comet_sum_compatbility_level branch from 0d481f4 to 2fdb835 Compare April 29, 2026 07:43
Comment thread spark/src/main/scala/org/apache/comet/serde/aggregates.scala
Comment thread spark/src/main/scala/org/apache/comet/serde/strings.scala Outdated
Comment thread spark/src/main/scala/org/apache/comet/serde/unixtime.scala
Copy link
Copy Markdown
Contributor Author

@coderfender coderfender left a comment

Choose a reason for hiding this comment

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

added some comments to help with review

Comment thread spark/src/main/scala/org/apache/comet/serde/strings.scala Outdated
Comment thread spark/src/main/scala/org/apache/comet/serde/unixtime.scala
object CometStringRepeat extends CometExpressionSerde[StringRepeat] {

override def getCompatibleNotes(): Seq[String] = Seq(
override def getIncompatibleReasons(): Seq[String] = Seq(
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

getIncompatibleReasons needs to be removed now that this issue has been fixed in #4017

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Actually that was the wrong issue ... why does this PR rename this method? There is no getSupportLevel so this expression is not marked as incompatible

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

True ! Thank you for pointing this out. I fixed it in the latest commit

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

some comments got lost I think due to GitHub outages ... I don't understand why this PR is removing getCompatibleNotes and adding getIncompatibleReasons

Comment thread spark/src/main/scala/org/apache/comet/serde/unixtime.scala Outdated
Comment thread spark/src/main/scala/org/apache/comet/serde/unixtime.scala Outdated
Copy link
Copy Markdown
Member

@andygrove andygrove left a comment

Choose a reason for hiding this comment

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

I want to make sure this PR does not get merged accidentally before feedback is addressed

query
SELECT repeat('hi', 3), repeat('', 5), repeat('a', 0), repeat(NULL, 3)

-- non-positive literal count
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

can you add non-literal test as well - that does not seem to be covered in the code change

@andygrove
Copy link
Copy Markdown
Member

@coderfender This PR has the title fix spark ansi sum incompatibility message but also makes changes to string_repeat and from_unix_time. There is also no information in the PR description. Maybe you could update the title and description?

Literal.create(null, StringType),
Literal(UTF8String.EMPTY_UTF8, StringType))
return exprToProtoInternal(ifExpr, inputs, binding)
case _ =>
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

we could consider just falling back to Spark if the second arg is not a literal

@coderfender
Copy link
Copy Markdown
Contributor Author

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.

Fix issues found when documenting current expression incompatibilities

2 participants