coderfender commented on code in PR #2932:
URL: https://github.com/apache/datafusion-comet/pull/2932#discussion_r2629271403


##########
spark/src/test/scala/org/apache/spark/sql/benchmark/CometCastBenchmark.scala:
##########
@@ -0,0 +1,116 @@
+/*
+ * 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.spark.sql.benchmark
+
+import scala.util.Try
+
+import org.apache.spark.benchmark.Benchmark
+import org.apache.spark.sql.SparkSession
+import org.apache.spark.sql.internal.SQLConf
+import org.apache.spark.sql.types.{DataType, LongType}
+
+import org.apache.comet.CometConf
+import org.apache.comet.expressions.{CometCast, CometEvalMode}
+import org.apache.comet.serde.{Compatible, Incompatible, Unsupported}
+
+/**
+ * Benchmark to measure Comet execution performance. To run this benchmark:
+ * {{{
+ *   SPARK_GENERATE_BENCHMARK_FILES=1 make 
benchmark-org.apache.spark.sql.benchmark.CometCastBenchmark
+ * }}}
+ *
+ * Results will be written to 
"spark/benchmarks/CometCastBenchmark-**results.txt".
+ */
+
+object CometCastBenchmark extends CometBenchmarkBase {
+
+  override def getSparkSession: SparkSession = {
+    val session = super.getSparkSession
+    session.conf.set("parquet.enable.dictionary", "false")
+    session.conf.set("spark.sql.shuffle.partitions", "2")
+    session
+  }
+
+  // Wrapper on SQL cast function
+  case class BenchCastExpression(name: DataType) {

Review Comment:
   I wanted to box the cast expression to make it easier to add additional 
parameter (like changing scale and precision for decimal type etc) . however, I 
do agree that it might be redundant at the moment and I removed it . Thank you 
@andygrove 



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