Skip to content

[SPARK-47497][SQL][FOLLOWUP] Add a UT for nested structure for the function to_csv - #45692

Closed
panbingkun wants to merge 1 commit into
apache:masterfrom
panbingkun:to_csv_ut
Closed

[SPARK-47497][SQL][FOLLOWUP] Add a UT for nested structure for the function to_csv#45692
panbingkun wants to merge 1 commit into
apache:masterfrom
panbingkun:to_csv_ut

Conversation

@panbingkun

@panbingkun panbingkun commented Mar 25, 2024

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

The pr aims to add a UT for nested structure for the function to_csv.
FollowUp: #45657

Why are the changes needed?

Add a UT, improve test coverage.
image

Does this PR introduce any user-facing change?

No.

How was this patch tested?

  • Manually test.
  • Pass GA.

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

No.

@github-actions github-actions Bot added the SQL label Mar 25, 2024
@panbingkun panbingkun changed the title [SPARK-47497][SQL][FOLLOWUP] Add a UT for nested structure [SPARK-47497][SQL][FOLLOWUP] Add a UT for nested structure for the function to_csv Mar 25, 2024
@panbingkun
panbingkun marked this pull request as ready for review March 25, 2024 07:59
@panbingkun

Copy link
Copy Markdown
Contributor Author

cc @LuciferYang

@LuciferYang LuciferYang left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

+1, LGTM (pending test)
also cc @cloud-fan

val df = spark.createDataFrame(rows, schema)
val actual1 = df.select(to_csv($"value"))
checkAnswer(actual1, Row("2,Alice," +
"\"[{math -> 100, english -> 200, science ->}, " +

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Are we really going to settle this down as a formal behaviour? Is this upported in Spark Connect with Scala client?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes, this be supported in Spark Connect with Scala client, double-check as follows:
image

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

What about Spark Connect with Python?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Ah, okay it's fixed in #45657

@cloud-fan

Copy link
Copy Markdown
Contributor

thanks, merging to master!

@cloud-fan cloud-fan closed this in 0340f80 Mar 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants