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

chore: Move cast to spark-expr crate #654

Merged
merged 7 commits into from
Jul 12, 2024

Conversation

andygrove
Copy link
Member

@andygrove andygrove commented Jul 11, 2024

Which issue does this PR close?

Part of #630

Rationale for this change

Move another expr to the new spark-expr crate.

What changes are included in this PR?

Just moving code around. No functional changes.

Specific changes

  • Move spark_cast function from utils.rs to cast.rs to keep all cast code together
  • Move some utility functions from core crate into datafusion_comet_utils
  • Move cast.rs into datafusion_comet_spark_expr

How are these changes tested?

Existing tests

@andygrove andygrove marked this pull request as ready for review July 12, 2024 12:56
@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 53.82%. Comparing base (8274a61) to head (6d1e697).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##               main     #654   +/-   ##
=========================================
  Coverage     53.82%   53.82%           
  Complexity      811      811           
=========================================
  Files           106      106           
  Lines         10242    10242           
  Branches       1917     1917           
=========================================
  Hits           5513     5513           
  Misses         3752     3752           
  Partials        977      977           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

// | Any other type | Not Supported |
// | --------------------- | ------------ | ----------------- | -------------------------------- |
//
pub fn array_with_timezone(
Copy link
Member

Choose a reason for hiding this comment

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

I think these functions are specified to Spark cast. Maybe they should be with cast expression in spark-expr crate?

Copy link
Member Author

Choose a reason for hiding this comment

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

array_with_timezone is also called from some other expressions in temporal.rs. Once all the expressions are moved to the new crate then maybe we can move some of these utility functions there as well.

Copy link
Member Author

Choose a reason for hiding this comment

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

I suppose some of these functions could just live in the spark-expr crate. I will look at that as a follow on issue.

@andygrove andygrove merged commit 7783b39 into apache:main Jul 12, 2024
75 checks passed
@andygrove andygrove deleted the move-cast-to-spark-expr branch July 12, 2024 19:21
himadripal pushed a commit to himadripal/datafusion-comet that referenced this pull request Sep 7, 2024
* refactor in preparation for moving cast to spark-expr crate

* errors

* move cast to spark-expr crate

* machete

* refactor errors

* clean up imports
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.

4 participants