Skip to content

chore: Refactor cast module temporal types#3624

Merged
andygrove merged 6 commits intoapache:mainfrom
coderfender:refactor_cast_module_temporal_complex
Mar 4, 2026
Merged

chore: Refactor cast module temporal types#3624
andygrove merged 6 commits intoapache:mainfrom
coderfender:refactor_cast_module_temporal_complex

Conversation

@coderfender
Copy link
Contributor

@coderfender coderfender commented Mar 3, 2026

Which issue does this PR close?

Closes #3459 .
This should be the final part of cast modularization and split them up by their source data types. Complex types repeatedly call cast_array which might not make the functions good candidates to make up their own file apart from the relatively less volume . However, if things do change, we could always revisit and move things out to a new file.

Rationale for this change

What changes are included in this PR?

  1. Create is_df_cast_from_date/timestamp_spark_compatible to move out the df related cast match argumentto temporal.rs
  2. Moved date and time related casts to temporal.rs

How are these changes tested?

@coderfender coderfender changed the title chore: Refactor cast module temporal chore: Refactor cast module temporal types Mar 3, 2026
@coderfender
Copy link
Contributor Author

@andygrove , this should be the last PR re cast module refactor. I will rebase the changes once #3623 is merged to close out on #3459

@coderfender coderfender marked this pull request as ready for review March 3, 2026 17:30
@coderfender
Copy link
Contributor Author

Fixed merge conflicts with main

Copy link
Contributor

@parthchandra parthchandra left a comment

Choose a reason for hiding this comment

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

minor comment. lgtm otherwise.

use std::sync::Arc;

/// Check if DataFusion cast from integer types is Spark compatible
pub(crate) fn is_df_cast_from_int_spark_compatible(to_type: &DataType) -> bool {
Copy link
Contributor

Choose a reason for hiding this comment

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

Could the is_*_spark_compatible functions be inline?

@coderfender
Copy link
Contributor Author

Thank you @parthchandra @andygrove

@andygrove andygrove merged commit aaaa6a6 into apache:main Mar 4, 2026
112 checks passed
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.

RFC: Cast sub system Modularization

3 participants