Github user sameeragarwal commented on a diff in the pull request:

    https://github.com/apache/spark/pull/14304#discussion_r71787200
  
    --- Diff: 
sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/parquet/ParquetEncodingSuite.scala
 ---
    @@ -78,4 +78,29 @@ class ParquetEncodingSuite extends 
ParquetCompatibilityTest with SharedSQLContex
           }}
         }
       }
    +
    +  test("Read row group containing both dictionary and plain encoded 
pages") {
    +    spark.conf.set("parquet.dictionary.page.size", "2048")
    +    spark.conf.set("parquet.page.size", "4096")
    +
    +    withTempPath { dir =>
    +      // In order to explicitly test for SPARK-14217, we set the parquet 
dictionary and page size
    +      // such that the following data spans across 3 pages (within a 
single row group) where the
    +      // first page is dictionary encoded and the remaining two are plain 
encoded.
    +      val data = (0 until 512).flatMap(i => List(i.toString, i.toString, 
i.toString))
    +      data.toDF("f").coalesce(1).write.parquet(dir.getCanonicalPath)
    +      val file = 
SpecificParquetRecordReaderBase.listDirectory(dir).toArray.head
    +
    +      val reader = new VectorizedParquetRecordReader
    +      reader.initialize(file.asInstanceOf[String], null)
    +      val batch = reader.resultBatch()
    +      assert(reader.nextBatch())
    +
    +      (0 until 512).foreach { i =>
    +        assert(batch.column(0).getUTF8String(3 * i).toString == i.toString)
    --- End diff --
    
    Unfortunately, using ints wouldn't produce this hybrid encoding that we're 
testing for (it just ends up producing 2 dictionary encoded pages).


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to