MaxGekk commented on a change in pull request #32339:
URL: https://github.com/apache/spark/pull/32339#discussion_r620000002
##########
File path:
sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/MutableProjectionSuite.scala
##########
@@ -50,8 +51,10 @@ class MutableProjectionSuite extends SparkFunSuite with
ExpressionEvalHelper {
testBothCodegenAndInterpreted("unsafe buffer") {
val inputRow = InternalRow.fromSeq(Seq(
false, 1.toByte, 9.toShort, -18, 53L, 3.2f, 7.8, 4, 9L, Int.MinValue,
Long.MaxValue))
- val numBytes =
UnsafeRow.calculateBitSetWidthInBytes(fixedLengthTypes.length)
- val unsafeBuffer = UnsafeRow.createFromByteArray(numBytes,
fixedLengthTypes.length)
+ val numFields = fixedLengthTypes.length
+ val numBytes = Platform.BYTE_ARRAY_OFFSET +
UnsafeRow.calculateBitSetWidthInBytes(numFields) +
+ UnsafeRow.WORD_SIZE * numFields
Review comment:
It depends how underlying byte array allocated. If you are lucky, you
overwrite not important memory of neighbours.
--
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]