wankunde commented on PR #44351:
URL: https://github.com/apache/spark/pull/44351#issuecomment-1855412209

   Local benchmark code
   
   ```scala
   object ParquetDictionaryDecoderBenchmark extends SqlBasedBenchmark {
   
     import spark.implicits._
   
     private val N = 100 * 1024 * 1024
     private val NUMBER_OF_ITER = 10
   
   
     override def runBenchmarkSuite(mainArgs: Array[String]): Unit = {
       withTempPath { tempDir =>
         val outputPath = tempDir.getCanonicalPath
         val df: DataFrame = spark
           .range(1, N, 1, 1)
           .map(id => ("ABCDEFG", "HIJKLMN", "OPQRST", "UVWXYZ"))
           .toDF("a", "b", "c", "d")
         df.write.mode(SaveMode.Overwrite).parquet(outputPath)
         val benchmark = new Benchmark("Parquet dictionary", N, NUMBER_OF_ITER, 
output = output)
           benchmark.addCase("Read binary dictionary") { _ =>
             spark.read.parquet(outputPath).noop()
           }
         benchmark.run()
       }
     }
   }
   ```


-- 
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]

Reply via email to