We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a93fd4b commit ed40d8fCopy full SHA for ed40d8f
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/codegen/CodeGenerator.scala
@@ -137,7 +137,8 @@ class CodeGenContext {
137
dataType match {
138
case _ if isPrimitiveType(jt) => s"$row.set${primitiveTypeName(jt)}($ordinal, $value)"
139
case t: DecimalType => s"$row.setDecimal($ordinal, $value, ${t.precision})"
140
- case StringType => s"$row.update($ordinal, $value)"
+ // The UTF8String may came from UnsafeRow, otherwise clone is cheap (re-use the bytes)
141
+ case StringType => s"$row.update($ordinal, $value.clone())"
142
case _ => s"$row.update($ordinal, $value)"
143
}
144
0 commit comments