coderfender commented on code in PR #4278:
URL: https://github.com/apache/datafusion-comet/pull/4278#discussion_r3253782315
##########
spark/src/test/scala/org/apache/comet/CometCastSuite.scala:
##########
@@ -1769,6 +1767,36 @@ class CometCastSuite extends CometTestBase with
AdaptiveSparkPlanHelper {
}
}
+ private def generateNestedArrays(rowNum: Int, elementType: DataType):
DataFrame = {
+ import scala.jdk.CollectionConverters._
+ val schema = StructType(Seq(StructField("a",
ArrayType(ArrayType(elementType)), true)))
+ val innerArrays = generateArrays(rowNum, elementType)
+ .collect()
+ .map { row =>
+ if (row.isNullAt(0)) {
+ null
+ } else {
+ row.getSeq[Any](0)
+ }
+ }
+ .toSeq
+
+ def buildRows(values: Seq[Seq[Any]]): Seq[Row] = {
+ Range(0, rowNum).map { i =>
+ Row(
+ Seq[Any](
+ values(i % values.length),
+ if (i % 3 == 0) null else values((i + 1) % values.length),
Review Comment:
nit : may be add a comment to let user's know every 3rd element is null ?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]