Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 05478200BCB for ; Thu, 24 Nov 2016 19:09:22 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 03D69160B1E; Thu, 24 Nov 2016 18:09:22 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 4BBD9160AFB for ; Thu, 24 Nov 2016 19:09:21 +0100 (CET) Received: (qmail 43375 invoked by uid 500); 24 Nov 2016 18:09:20 -0000 Mailing-List: contact reviews-help@spark.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list reviews@spark.apache.org Received: (qmail 43356 invoked by uid 99); 24 Nov 2016 18:09:20 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 24 Nov 2016 18:09:20 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id D517DDFCC7; Thu, 24 Nov 2016 18:09:19 +0000 (UTC) From: kiszk To: reviews@spark.apache.org Reply-To: reviews@spark.apache.org References: In-Reply-To: Subject: [GitHub] spark pull request #15462: [SPARK-17680] [SQL] [TEST] Added test cases for I... Content-Type: text/plain Message-Id: <20161124180919.D517DDFCC7@git1-us-west.apache.org> Date: Thu, 24 Nov 2016 18:09:19 +0000 (UTC) archived-at: Thu, 24 Nov 2016 18:09:22 -0000 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