Skip to content
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

[SPARK-48337][SQL] Fix precision loss for JDBC TIME values #46662

Closed
wants to merge 2 commits into from

Conversation

yaooqinn
Copy link
Member

@yaooqinn yaooqinn commented May 20, 2024

What changes were proposed in this pull request?

The method java.sql.Time.toLocalTime discards the fraction parts of time values. In this pull request, we avoid using it by calculating milliseconds to microseconds directly.

Why are the changes needed?

fix precision loss

Does this PR introduce any user-facing change?

Yes,

  • Before this PR time values like 11:22.33.456 would result in 1970-01-01 11:22.33 where the fractional part was truncated.
  • After this PR, 1970-01-01 11:22.33.456

How was this patch tested?

new tests

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

no

@github-actions github-actions bot added the SQL label May 20, 2024
@yaooqinn
Copy link
Member Author

cc @cloud-fan @LuciferYang @dongjoon-hyun thanks

@dongjoon-hyun
Copy link
Member

Thank you, @yaooqinn .

Copy link
Contributor

@LuciferYang LuciferYang 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

@yaooqinn yaooqinn closed this in 2a1bdc3 May 21, 2024
@yaooqinn
Copy link
Member Author

Merged to master. Thank you @dongjoon-hyun @LuciferYang

@yaooqinn yaooqinn deleted the SPARK-48337 branch May 21, 2024 03:14
@cloud-fan
Copy link
Contributor

late LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
4 participants