Skip to content

Commit ed40d8f

Browse files
committed
add the copy back
1 parent a93fd4b commit ed40d8f

File tree

1 file changed

+2
-1
lines changed
  • sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/codegen

1 file changed

+2
-1
lines changed

sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/codegen/CodeGenerator.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,8 @@ class CodeGenContext {
137137
dataType match {
138138
case _ if isPrimitiveType(jt) => s"$row.set${primitiveTypeName(jt)}($ordinal, $value)"
139139
case t: DecimalType => s"$row.setDecimal($ordinal, $value, ${t.precision})"
140-
case StringType => s"$row.update($ordinal, $value)"
140+
// The UTF8String may came from UnsafeRow, otherwise clone is cheap (re-use the bytes)
141+
case StringType => s"$row.update($ordinal, $value.clone())"
141142
case _ => s"$row.update($ordinal, $value)"
142143
}
143144
}

0 commit comments

Comments
 (0)