Github user ueshin commented on a diff in the pull request:
https://github.com/apache/spark/pull/19367#discussion_r141360887
--- Diff:
sql/core/src/test/scala/org/apache/spark/sql/execution/vectorized/ColumnVectorSuite.scala
---
@@ -25,19 +25,25 @@ import org.apache.spark.sql.types._
import org.apache.spark.unsafe.types.UTF8String
class ColumnVectorSuite extends SparkFunSuite with BeforeAndAfterEach {
-
- var testVector: WritableColumnVector = _
-
- private def allocate(capacity: Int, dt: DataType): WritableColumnVector
= {
- new OnHeapColumnVector(capacity, dt)
+ private def withVector(
+ vector: WritableColumnVector)(
+ block: WritableColumnVector => Unit): Unit = {
+ try block(vector) finally vector.close()
}
- override def afterEach(): Unit = {
- testVector.close()
+ private def testVectors(
+ name: String,
+ size: Int,
+ dt: DataType)(
+ block: WritableColumnVector => Unit): Unit = {
+ test(name) {
+ val c1 = new OnHeapColumnVector(size, dt)
--- End diff --
What's this `c1` for?
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]