Skip to content

[SPARK-52660][SQL] Add time type to CodeGenerator#javaClass #51354

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

bersprockets
Copy link
Contributor

What changes were proposed in this pull request?

Update CodeGenerator#javaClass to map TimeType to Long.

Why are the changes needed?

The change is needed to fully support wholestage codegen for code using the time type. Without this change, the following query gets an error compiling the generated code (and falls back to non-wholestage codegen):

create or replace temp view v1(col1) as values
(time'22:33:01'),
(time'01:33:01'),
(null);

select max(col1), min(col1) from v1;

Does this PR introduce any user-facing change?

No. The time type is not released yet.

How was this patch tested?

New test.

Was this patch authored or co-authored using generative AI tooling?

No.

@github-actions github-actions bot added the SQL label Jul 3, 2025
@MaxGekk
Copy link
Member

MaxGekk commented Jul 3, 2025

+1, LGTM. Merging to master.
Thank you, @bersprockets and @yaooqinn for review.

@MaxGekk MaxGekk closed this in 031310b Jul 3, 2025
Copy link
Member

@dongjoon-hyun dongjoon-hyun left a comment

Choose a reason for hiding this comment

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

+1, LGTM.

@bersprockets
Copy link
Contributor Author

By the way, there are a couple more like this (that is, match expressions that need a case statement for the Time type). I will work though them separately, as they are for different bits of Spark SQL (e.g., interpreted mode projections, caching, and a few other odds and ends).

@dongjoon-hyun
Copy link
Member

Thank you for checking them thoroughly. Feel free to make small PRs (case by case), @bersprockets .

By the way, there are a couple more like this (that is, match expressions that need a case statement for the Time type). I will work though them separately, as they are for different bits of Spark SQL (e.g., interpreted mode projections, caching, and a few other odds and ends).

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.

4 participants