Github user rxin commented on a diff in the pull request:

    https://github.com/apache/spark/pull/7658#discussion_r35479711
  
    --- Diff: 
sql/core/src/test/scala/org/apache/spark/sql/execution/UnsafeRowSerializerSuite.scala
 ---
    @@ -22,29 +22,22 @@ import java.io.{ByteArrayInputStream, 
ByteArrayOutputStream}
     import org.apache.spark.SparkFunSuite
     import org.apache.spark.sql.Row
     import org.apache.spark.sql.catalyst.{CatalystTypeConverters, InternalRow}
    -import org.apache.spark.sql.catalyst.expressions.{UnsafeRow, 
UnsafeRowConverter}
    +import org.apache.spark.sql.catalyst.expressions.{UnsafeProjection, 
UnsafeRow}
     import org.apache.spark.sql.types._
    -import org.apache.spark.unsafe.PlatformDependent
     
     class UnsafeRowSerializerSuite extends SparkFunSuite {
     
       private def toUnsafeRow(row: Row, schema: Array[DataType]): UnsafeRow = {
         val internalRow = 
CatalystTypeConverters.convertToCatalyst(row).asInstanceOf[InternalRow]
    -    val rowConverter = new UnsafeRowConverter(schema)
    -    val rowSizeInBytes = rowConverter.getSizeRequirement(internalRow)
    -    val byteArray = new Array[Byte](rowSizeInBytes)
    -    rowConverter.writeRow(
    -      internalRow, byteArray, PlatformDependent.BYTE_ARRAY_OFFSET, 
rowSizeInBytes)
    -    val unsafeRow = new UnsafeRow()
    -    unsafeRow.pointTo(byteArray, PlatformDependent.BYTE_ARRAY_OFFSET, 
row.length, rowSizeInBytes)
    -    unsafeRow
    +    val converter = UnsafeProjection.create(schema)
    +    converter.apply(internalRow)
       }
     
    -  ignore("toUnsafeRow() test helper method") {
    +  test("toUnsafeRow() test helper method") {
    --- End diff --
    
    this test case can now be turned on since we have a specialized getter for 
strings.



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

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

Reply via email to