yihua commented on code in PR #20079:
URL: https://github.com/apache/hudi/pull/20079#discussion_r4169955047


##########
hudi-spark-datasource/hudi-spark/src/test/scala/org/apache/hudi/io/storage/ParquetPerFileReadBenchmark.scala:
##########
@@ -0,0 +1,175 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.hudi.io.storage
+
+import org.apache.hudi.SparkAdapterSupport.sparkAdapter
+import org.apache.hudi.common.util.{HoodieStorageUtils, Option => HOption}
+import org.apache.hudi.hadoop.fs.HadoopFSUtils
+import org.apache.hudi.storage.StoragePath
+import org.apache.hudi.util.CloseableInternalRowIterator
+
+import org.apache.hadoop.conf.Configuration
+import 
org.apache.parquet.avro.HoodieAvroParquetSchemaConverter.getAvroSchemaConverter
+import org.apache.spark.sql.SparkSession
+import org.apache.spark.sql.avro.HoodieSparkSchemaConverters
+import org.apache.spark.sql.catalyst.InternalRow
+import org.apache.spark.sql.execution.datasources.FileFormat
+import org.apache.spark.sql.types.StructType
+import org.junit.jupiter.api.Assertions.assertEquals
+import org.junit.jupiter.api.Test
+import org.junit.jupiter.api.io.TempDir
+
+import java.lang.management.ManagementFactory
+import java.nio.file.{Files, Path}
+
+import scala.collection.JavaConverters._
+
+/**
+ * Manual benchmark of the per-file CPU cost of the Spark parquet read paths: 
the log-file reader
+ * ([[HoodieSparkParquetReader]]) and the base-file reader built by the Spark 
adapter. Not run in CI
+ * (the class name matches no surefire include). Every round reads the same 
small files and checks
+ * the row count and a checksum, so a faster but wrong reader fails the run.
+ *
+ * {{{
+ * mvn test -pl hudi-spark-datasource/hudi-spark 
-Dtest=ParquetPerFileReadBenchmark \
+ *   -Dbenchmark.files=400 -Dbenchmark.rounds=10 -Dbenchmark.warmupRounds=3
+ * }}}
+ */
+class ParquetPerFileReadBenchmark {

Review Comment:
   this runs as a JUnit test and stays out of CI only because the class name 
does not match surefire's default Test* includes. Could you add `@Disabled` 
with a note that it is run by hand, so the intent survives a rename or an 
includes change?



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

Reply via email to