vinodkc commented on code in PR #59717:
URL: https://github.com/apache/spark/pull/59717#discussion_r4554033068
##########
sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/parquet/ParquetVectorizedSuite.scala:
##########
@@ -1032,6 +1132,82 @@ class ParquetVectorizedSuite extends ParquetTest with
SharedSparkSession {
columnWriterStore.flush()
}
+ /**
+ * The file schema and the element column of an optional array column `_1`,
whose elements are
+ * of the Parquet primitive type `elementType`, annotated with `logicalType`
if given.
+ */
+ private def arraySchema(
+ elementType: String,
+ logicalType: Option[String] = None): (MessageType, ColumnDescriptor) = {
+ val annotation = logicalType.map(t => s" ($t)").getOrElse("")
+ val parquetSchema = MessageTypeParser.parseMessageType(
+ s"""message root {
+ | optional group _1 (LIST) {
+ | repeated group list {
+ | optional $elementType a$annotation;
+ | }
+ | }
+ |}
+ |""".stripMargin)
+ val ty = parquetSchema.getType("_1", "list", "a").asPrimitiveType()
+ (parquetSchema, new ColumnDescriptor(Array("_1", "list", "a"), ty, 1, 3))
+ }
+
+ /** A data page given as its repetition levels, definition levels and
values. */
+ private case class EncodedPage(
+ repetitionLevels: Seq[Int],
+ definitionLevels: Seq[Int],
+ values: Seq[Any],
+ dictionaryEncoded: Boolean)
+
+ /**
+ * Returns a row group with a single column chunk made of `pages`, in order,
each PLAIN or
+ * dictionary encoded. Parquet writers normally fall back from dictionary to
PLAIN for good, so
+ * a dictionary page after a PLAIN one can't be produced with
`writeDataPage` alone. The
Review Comment:
Thanks @cloud-fan, fixed . The Scaladoc now attributes the per-page stores
to MemPageStore accepting only one dictionary page per column
--
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]