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

feat: Implement CAST from struct to string #1066

Merged
merged 10 commits into from
Nov 8, 2024

Conversation

andygrove
Copy link
Member

Which issue does this PR close?

Closes #814

Rationale for this change

As we add support for complex types, we will need to support CASTing them to string, so that users can run df.show() for example.

What changes are included in this PR?

Implement CAST from struct to string

How are these changes tested?

@andygrove andygrove marked this pull request as ready for review November 7, 2024 23:57
// https://github.com/apache/datafusion-comet/issues/1067 is resolved
// checkSparkAnswerAndOperator(
// "SELECT CAST(struct(_9, _10, _11, _12) as string) FROM tbl")
// decimals (_16 intentionally excluded due to formatting difference with scientific notation)
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's file an issue for _16? Not sure if it is related to struct or independent decimal issue.;

Copy link
Member Author

Choose a reason for hiding this comment

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

@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 66.66667% with 5 lines in your changes missing coverage. Please review.

Project coverage is 54.82%. Comparing base (845b654) to head (7cf7ab7).
Report is 12 commits behind head on main.

Files with missing lines Patch % Lines
...scala/org/apache/comet/expressions/CometCast.scala 66.66% 2 Missing and 3 partials ⚠️
Additional details and impacted files
@@              Coverage Diff              @@
##               main    #1066       +/-   ##
=============================================
+ Coverage     34.46%   54.82%   +20.35%     
+ Complexity      888      858       -30     
=============================================
  Files           113      110        -3     
  Lines         43580    10760    -32820     
  Branches       9658     2089     -7569     
=============================================
- Hits          15021     5899     -9122     
+ Misses        25507     3807    -21700     
+ Partials       3052     1054     -1998     

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

@andygrove andygrove merged commit 4f2a80d into apache:main Nov 8, 2024
74 checks passed
@andygrove andygrove deleted the cast-struct-to-utf8 branch November 8, 2024 15:46
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.

Implement cast from struct type to string
3 participants