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

Cast from integer/timestamp to timestamp/integer #5040

Merged
merged 3 commits into from
Nov 7, 2023

Conversation

viirya
Copy link
Member

@viirya viirya commented Nov 5, 2023

Which issue does this PR close?

Closes #5039.

Rationale for this change

What changes are included in this PR?

Are there any user-facing changes?

@github-actions github-actions bot added the arrow Changes to the arrow crate label Nov 5, 2023
Copy link
Contributor

@tustvold tustvold left a comment

Choose a reason for hiding this comment

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

This looks good, although I wonder if calling the kernel recursively might be simpler (and possibly less codegen)

(Timestamp(TimeUnit::Microsecond, _), _) if to_type.is_integer() => {
let array = cast_reinterpret_arrays::<TimestampMicrosecondType, Int64Type>(array)?;

match to_type {
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder if instead of this additional match block we could call the kernels recursively?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yea, it's simpler. 👍

@tustvold tustvold merged commit 8c20c98 into apache:master Nov 7, 2023
25 checks passed
@viirya
Copy link
Member Author

viirya commented Nov 7, 2023

Thank you @tustvold

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
arrow Changes to the arrow crate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cast from integer/timestamp to timestamp/integer
2 participants