Skip to content

feat: Support Spark expression hours_of_time#3615

Closed
0lai0 wants to merge 3 commits into
apache:mainfrom
0lai0:expression_hour_of_time
Closed

feat: Support Spark expression hours_of_time#3615
0lai0 wants to merge 3 commits into
apache:mainfrom
0lai0:expression_hour_of_time

Conversation

@0lai0

@0lai0 0lai0 commented Mar 1, 2026

Copy link
Copy Markdown
Contributor

Which issue does this PR close?

Closes #3126

Rationale for this change

Comet previously did not support the Spark HourOfTime expression, so queries using hour(time_expr) could fall back to JVM execution instead of running natively.

What changes are included in this PR?

This change adds a Serde handler for HourOfTime that reuses the existing Hour protobuf and Rust implementation, ensuring consistent behavior while avoiding new native code paths.

How are these changes tested?

Added a Scala unit test HourOfTime expression support in CometExpressionSuite
./mvnw test -Dsuites="org.apache.comet.CometSqlFileTestSuite hour,org.apache.comet.CometExpressionSuite hour" -Dtest=none
./mvnw clean compile -DskipTests

}
}

def hoursOfTimeToProto(

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.

It might make more sense to place hoursOfTimeToProto alongside the existing CometHour handler in datetime.scala, since that's where the Hour serde already lives.

@0lai0 0lai0 Mar 4, 2026

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.

Thanks @andygrove for the feedback. I'll prioritize completing secondsoftime first since there are components we can share between the two.

@0lai0 0lai0 changed the title feat: Support Spark expression hour_of_time feat: Support Spark expression hours_of_time Mar 3, 2026
@0lai0 0lai0 marked this pull request as draft March 5, 2026 03:21
@github-actions

github-actions Bot commented May 5, 2026

Copy link
Copy Markdown

Thank you for your contribution. Unfortunately, this pull request is stale because it has been open 60 days with no activity. Please remove the stale label or comment or this will be closed in 7 days.

@github-actions github-actions Bot added the Stale label May 5, 2026
@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown

Thank you for your contribution. Unfortunately, this pull request is stale because it has been open 60 days with no activity. Please remove the stale label or comment or this will be closed in 7 days.

@0lai0

0lai0 commented Jul 8, 2026

Copy link
Copy Markdown
Contributor Author

Closing in favor of #4860, which supersedes this PR.
Thanks @andygrove for review.

@0lai0 0lai0 closed this Jul 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] Support Spark expression: hours_of_time

2 participants