spark-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kiszk <...@git.apache.org>
Subject [GitHub] spark pull request #15462: [SPARK-17680] [SQL] [TEST] Added test cases for I...
Date Thu, 24 Nov 2016 18:09:19 GMT
Github user kiszk commented on a diff in the pull request:

    https://github.com/apache/spark/pull/15462#discussion_r89535856
  
    --- Diff: sql/core/src/test/scala/org/apache/spark/sql/execution/columnar/InMemoryColumnarQuerySuite.scala
---
    @@ -20,18 +20,83 @@ package org.apache.spark.sql.execution.columnar
     import java.nio.charset.StandardCharsets
     import java.sql.{Date, Timestamp}
     
    -import org.apache.spark.sql.{QueryTest, Row}
    +import org.apache.spark.sql.{DataFrame, QueryTest, Row}
     import org.apache.spark.sql.internal.SQLConf
     import org.apache.spark.sql.test.SharedSQLContext
     import org.apache.spark.sql.test.SQLTestData._
     import org.apache.spark.sql.types._
    -import org.apache.spark.storage.StorageLevel.MEMORY_ONLY
    +import org.apache.spark.storage.StorageLevel._
     
     class InMemoryColumnarQuerySuite extends QueryTest with SharedSQLContext {
       import testImplicits._
     
       setupTestData()
     
    +  def cachePrimitiveTest(data: DataFrame, dataType: String) {
    +    data.createOrReplaceTempView(s"testData$dataType")
    +    val storageLevel = MEMORY_ONLY
    +    val plan = spark.sessionState.executePlan(data.logicalPlan).sparkPlan
    +    val inMemoryRelation = InMemoryRelation(useCompression = true, 5, storageLevel, plan,
None)
    +
    +    assert(inMemoryRelation.cachedColumnBuffers.getStorageLevel == storageLevel)
    +    inMemoryRelation.cachedColumnBuffers.collect().head match {
    +      case _: CachedBatch => assert(true)
    +      case other => fail(s"Unexpected cached batch type: ${other.getClass.getName}")
    +    }
    +    checkAnswer(inMemoryRelation, data.collect().toSeq)
    +  }
    +
    +  test("all data type w && w/o nullability") {
    +    // all primitives
    +    Seq(true, false).map { nullability =>
    --- End diff --
    
    OK. I created smaller multiple tests


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Mime
View raw message