Github user viirya commented on a diff in the pull request: https://github.com/apache/spark/pull/20935#discussion_r178444386 --- Diff: sql/core/src/test/scala/org/apache/spark/sql/execution/columnar/ColumnStatsSuite.scala --- @@ -103,4 +119,109 @@ class ColumnStatsSuite extends SparkFunSuite { } } } + + def testArrayColumnStats( + dataType: DataType, orderable: Boolean, initialStatistics: Array[Any]): Unit = { + val columnType = ColumnType(dataType) + + test(s"${dataType.typeName}: empty") { + val objectStats = new ArrayColumnStats(dataType) + objectStats.collectedStatistics.zip(initialStatistics).foreach { + case (actual, expected) => assert(actual === expected) + } + } + + test(s"${dataType.typeName}: non-empty") { + import org.apache.spark.sql.execution.columnar.ColumnarTestUtils._ + val objectStats = new ArrayColumnStats(dataType) + val rows = Seq.fill(10)(makeRandomRow(columnType)) ++ Seq.fill(10)(makeNullRow(1)) --- End diff -- Because we don't reuse the unsafe array/row here, we don't actually test on the copying in corresponding column statistics, can we have the test data reusing the unsafe structures to test array and struct column statistics?
--- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org