kiszk commented on a change in pull request #29654:
URL: https://github.com/apache/spark/pull/29654#discussion_r486972465



##########
File path: 
sql/core/src/main/scala/org/apache/spark/sql/execution/columnar/compression/compressionSchemes.scala
##########
@@ -195,16 +193,16 @@ private[columnar] case object RunLengthEncoding extends 
CompressionScheme {
       val actualSize = columnType.actualSize(row, ordinal)
       _uncompressedSize += actualSize
 
-      if (lastValue.isNullAt(0)) {
-        columnType.copyField(row, ordinal, lastValue, 0)
+      if (lastValue == null) {
+        lastValue = columnType.clone(columnType.getField(row, ordinal))

Review comment:
       Do we need `clone()` here?  While I guess that this is for `UTF8String`, 
`lastValue` is used only for keeping a value. Thus, it is ok with just keeping 
the reference for `UTF8String`.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to