Skip to content

Commit

Permalink
Merge pull request #9895 from NVIDIA/branch-23.12
Browse files Browse the repository at this point in the history
[auto-merge] branch-23.12 to branch-24.02 [skip ci] [bot]
  • Loading branch information
nvauto authored Nov 29, 2023
2 parents df4b1dc + 31aee63 commit 6500a94
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions sql-plugin/src/main/scala/com/nvidia/spark/rapids/GpuCast.scala
Original file line number Diff line number Diff line change
Expand Up @@ -1124,13 +1124,15 @@ object GpuCast {
}
if (options.ignoreNullFieldsInStructs) {
// write the value
val attrValue = castToString(cv, inputSchema(fieldIndex).dataType, options)
if (needsQuoting) {
attrColumns += quote.incRefCount()
attrColumns += escapeJsonString(attrValue)
attrColumns += quote.incRefCount()
} else {
attrColumns += attrValue
withResource(castToString(cv, inputSchema(fieldIndex).dataType, options)) {
attrValue =>
if (needsQuoting) {
attrColumns += quote.incRefCount()
attrColumns += escapeJsonString(attrValue)
attrColumns += quote.incRefCount()
} else {
attrColumns += attrValue.incRefCount()
}
}
// now concatenate
val jsonAttr = withResource(Scalar.fromString("")) { emptyString =>
Expand Down

0 comments on commit 6500a94

Please sign in to comment.