From 03fc030a55650c49360b8daca6713185ab45ff78 Mon Sep 17 00:00:00 2001 From: Xianjin YE Date: Tue, 21 May 2024 21:36:48 +0800 Subject: [PATCH] remove array type match case, which should already been handled in RandomDataGenerator.forType --- .../org/apache/comet/DataGenerator.scala | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/spark/src/test/scala/org/apache/comet/DataGenerator.scala b/spark/src/test/scala/org/apache/comet/DataGenerator.scala index 7ebd890a9..06deff555 100644 --- a/spark/src/test/scala/org/apache/comet/DataGenerator.scala +++ b/spark/src/test/scala/org/apache/comet/DataGenerator.scala @@ -109,25 +109,8 @@ class DataGenerator(r: Random) { val fields = mutable.ArrayBuffer.empty[Any] schema.fields.foreach { f => f.dataType match { - case ArrayType(childType, nullable) => - val data = if (f.nullable && r.nextFloat() <= PROBABILITY_OF_NULL) { - null - } else { - val arr = mutable.ArrayBuffer.empty[Any] - val n = 1 // rand.nextInt(10) - var i = 0 - val generator = RandomDataGenerator.forType(childType, nullable, r) - assert(generator.isDefined, "Unsupported type") - val gen = generator.get - while (i < n) { - arr += gen() - i += 1 - } - arr.toSeq - } - fields += data case StructType(children) => - fields += generateRow(StructType(children)) + fields += generateRow(StructType(children), stringGen) case StringType if stringGen.isDefined => val gen = stringGen.get val data = if (f.nullable && r.nextFloat() <= PROBABILITY_OF_NULL) {