Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fix conflicts and DataFrameFunctionsSuite #21
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
Uh oh!
There was an error while loading. Please reload this page.
Fix conflicts and DataFrameFunctionsSuite #21
Changes from 1 commit
40ffdefede05fa6fb1d43898bff2bd94419bc9b259558fc897b1b45087ad4b405508cf5cc60f433378a6891f6942fd47026bee26809d6b320b1b676aea9e87c1968a10aee601c2343f7e0a83f6c90efae3237885e615e3f3f5e846cf90271cc81ed0d31700277e006f11e4706007c31d281a8e1b626528a01856d8b2d03205750de400a8d3fa36e8bb61411de1477a36d479815a57efdb74aa8c87a5b37f1b68d819509d037497e6c149dcb8791767b7cf4482185f3c0157778b582dac19b82507a4f3c43151d9723f276f533b8ca81a56df6ee53da30d0b01ad46db4a4091993bc374d95faa02ee21e6b0f1e410b05ef45fbf255ecbb16b9f2de888229b1b8136c7222e1c3dc2d09ef269324bd349df781079339c6b0651File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
…Row.jsonValue ### What changes were proposed in this pull request? In this Pull request, I propose to add a LocalDateTime serializer to the Row.jsonValue method ```scala case (d: LocalDateTime, _) => JString(timestampFormatter.format(d)) ``` In order to enable JSON serialization of _TimestampNTZType_ columns ### Why are the changes needed? Currently trying to serialize a Row containing a _TimestampNTZType_ column results in an error: ```java [FAILED_ROW_TO_JSON] Failed to convert the row value '2018-05-14T12:13' of the class class java.time.LocalDateTime to the target SQL type "TIMESTAMPNTZTYPE" in the JSON format. SQLSTATE: 2203G org.apache.spark.SparkIllegalArgumentException: [FAILED_ROW_TO_JSON] Failed to convert the row value '2018-05-14T12:13' of the class class java.time.LocalDateTime to the target SQL type "TIMESTAMPNTZTYPE" in the JSON format. SQLSTATE: 2203G at org.apache.spark.sql.Row.toJson$1(Row.scala:663) at org.apache.spark.sql.Row.toJson$1(Row.scala:651) at org.apache.spark.sql.Row.jsonValue(Row.scala:665) at org.apache.spark.sql.Row.jsonValue$(Row.scala:598) at org.apache.spark.sql.catalyst.expressions.GenericRow.jsonValue(rows.scala:28) at org.apache.spark.sql.RowJsonSuite.$anonfun$testJson$1(RowJsonSuite.scala:41) ``` How to reproduce the issue: ```scala import org.apache.spark.sql.Row import java.time.LocalDateTime val r = Row.fromSeq(LocalDateTime.of(2024,8,10,12,33) :: Nil) r.json r.prettyJson ``` ### Does this PR introduce _any_ user-facing change? No ### How was this patch tested? Tests were added to the already existing RowJsonSuite.scala class ### Was this patch authored or co-authored using generative AI tooling? No Closes apache#48905 from karim-ramadan/bugfix/LocalDateTime-support-in-Row-json. Authored-by: Karim Ramadan <[email protected]> Signed-off-by: Max Gekk <[email protected]>Uh oh!
There was an error while loading. Please reload this page.
There are no files selected for viewing