From e25a7f01f58596c9b1422d3e79bb34b436d1f93d Mon Sep 17 00:00:00 2001 From: Yangyang Gao Date: Mon, 23 Oct 2023 19:30:13 +0800 Subject: [PATCH] address comment --- .../execution/VeloxColumnarCacheSuite.scala | 32 ++++++++++--------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/backends-velox/src/test/scala/io/glutenproject/execution/VeloxColumnarCacheSuite.scala b/backends-velox/src/test/scala/io/glutenproject/execution/VeloxColumnarCacheSuite.scala index ac58db67dc66..267a7bc15ce4 100644 --- a/backends-velox/src/test/scala/io/glutenproject/execution/VeloxColumnarCacheSuite.scala +++ b/backends-velox/src/test/scala/io/glutenproject/execution/VeloxColumnarCacheSuite.scala @@ -109,21 +109,23 @@ class VeloxColumnarCacheSuite extends VeloxWholeStageTransformerSuite with Adapt } } - // test("Support transform count(1) with table cache") { - // val cached = spark.table("lineitem").cache() - // try { - // val df = spark.sql("SELECT COUNT(*) FROM lineitem") - // checkAnswer(df, Row(60175)) - // assert( - // find(df.queryExecution.executedPlan) { - // case _: RowToVeloxColumnarExec => true - // case _ => false - // }.isEmpty - // ) - // } finally { - // cached.unpersist() - // } - // } + test("Support transform count(1) with table cache") { + withSQLConf(GlutenConfig.COLUMNAR_TABLE_CACHE_ENABLED.key -> "true") { + val cached = spark.table("lineitem").cache() + try { + val df = spark.sql("SELECT COUNT(*) FROM lineitem") + checkAnswer(df, Row(60175)) + assert( + find(df.queryExecution.executedPlan) { + case _: RowToVeloxColumnarExec => true + case _ => false + }.isEmpty + ) + } finally { + cached.unpersist() + } + } + } test("no ColumnarToRow for table cache") { val cached = spark.table("lineitem").cache()