Github user cloud-fan commented on a diff in the pull request:

    https://github.com/apache/spark/pull/18468#discussion_r128233335
  
    --- Diff: 
sql/core/src/test/scala/org/apache/spark/sql/execution/vectorized/ColumnarBatchSuite.scala
 ---
    @@ -326,6 +329,79 @@ class ColumnarBatchSuite extends SparkFunSuite {
         }}
       }
     
    +  test("CachedBatch primitive Apis") {
    +    (BooleanType :: IntegerType :: DoubleType :: Nil).foreach { dataType 
=> {
    +      val columnBuilder = ColumnBuilderHelper(dataType, 1024, "col", true)
    +      val row = new SpecificInternalRow(Array(dataType))
    +      for (i <- 0 until 16) {
    +        dataType match {
    +          case _ : BooleanType => row.setBoolean(0, i % 2 == 0)
    +          case _ : IntegerType => row.setInt(0, i)
    +          case _ : DoubleType => row.setDouble(0, i)
    +        }
    +        columnBuilder.appendFrom(row, 0)
    +      }
    +
    +      val column = new CachedBatchColumnVector(
    +        JavaUtils.bufferToArray(columnBuilder.build), 1024, dataType)
    +
    +      for (i <- 0 until 16) {
    +        assert(column.isNullAt(i) == false)
    +        dataType match {
    +          case _ : BooleanType => assert(column.getBoolean(i) == (i % 2 == 
0))
    +          case _ : IntegerType => assert(column.getInt(i) == i)
    +          case _ : DoubleType => assert(column.getDouble(i) == i.toDouble)
    +        }
    +      }
    +
    +      /* check row access order */
    +      val column2 = new CachedBatchColumnVector(
    +        JavaUtils.bufferToArray(columnBuilder.build), 1024, dataType)
    +      dataType match {
    +        case _: BooleanType =>
    +          /* Row access may not start with non-0 */
    --- End diff --
    
    this is not true now


---
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