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

    https://github.com/apache/spark/pull/19367#discussion_r141370506
  
    --- Diff: 
sql/core/src/test/scala/org/apache/spark/sql/execution/vectorized/ColumnarBatchSuite.scala
 ---
    @@ -38,31 +38,45 @@ import org.apache.spark.unsafe.types.CalendarInterval
     
     class ColumnarBatchSuite extends SparkFunSuite {
     
    -  def allocate(capacity: Int, dt: DataType, memMode: MemoryMode): 
WritableColumnVector = {
    +  private def allocate(capacity: Int, dt: DataType, memMode: MemoryMode): 
WritableColumnVector = {
         if (memMode == MemoryMode.OFF_HEAP) {
           new OffHeapColumnVector(capacity, dt)
         } else {
           new OnHeapColumnVector(capacity, dt)
         }
       }
     
    -  test("Null Apis") {
    -    (MemoryMode.ON_HEAP :: MemoryMode.OFF_HEAP :: Nil).foreach { memMode 
=> {
    -      val reference = mutable.ArrayBuffer.empty[Boolean]
    +  private def testVector(
    +      name: String,
    +      size: Int,
    +      dt: DataType,
    +      modes: MemoryMode*)(
    +      block: (WritableColumnVector, MemoryMode) => Unit): Unit = {
    +    test(name) {
    +      modes.foreach { mode =>
    +        val vector = allocate(size, dt, mode)
    +        try block(vector, mode) finally {
    --- End diff --
    
    The way you use `{}` here is weird.


---

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

Reply via email to