forked from apache/incubator-gluten
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9d07d48
commit b253ea7
Showing
6 changed files
with
157 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
74 changes: 74 additions & 0 deletions
74
backends-velox/src/test/scala/io/glutenproject/execution/VeloxMetricsSuite.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
/* | ||
* 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 io.glutenproject.execution | ||
|
||
import io.glutenproject.GlutenConfig | ||
|
||
import org.apache.spark.sql.execution.adaptive.AdaptiveSparkPlanHelper | ||
import org.apache.spark.sql.internal.SQLConf | ||
|
||
class VeloxMetricsSuite extends VeloxWholeStageTransformerSuite with AdaptiveSparkPlanHelper { | ||
override protected val backend: String = "velox" | ||
override protected val resourcePath: String = "/tpch-data-parquet-velox" | ||
override protected val fileFormat: String = "parquet" | ||
|
||
override def beforeAll(): Unit = { | ||
super.beforeAll() | ||
|
||
spark | ||
.range(100) | ||
.selectExpr("id as c1", "id % 3 as c2") | ||
.write | ||
.format("parquet") | ||
.saveAsTable("metrics_t1") | ||
|
||
spark | ||
.range(200) | ||
.selectExpr("id as c1", "id % 3 as c2") | ||
.write | ||
.format("parquet") | ||
.saveAsTable("metrics_t2") | ||
} | ||
|
||
override protected def afterAll(): Unit = { | ||
spark.sql("drop table metrics_t1") | ||
spark.sql("drop table metrics_t2") | ||
|
||
super.afterAll() | ||
} | ||
|
||
test("test sort merge join metrics") { | ||
withSQLConf( | ||
GlutenConfig.COLUMNAR_FPRCE_SHUFFLED_HASH_JOIN_ENABLED.key -> "false", | ||
SQLConf.AUTO_BROADCASTJOIN_THRESHOLD.key -> "-1") { | ||
runQueryAndCompare( | ||
"SELECT * FROM metrics_t1 join metrics_t2 on metrics_t1.c1 = metrics_t2.c1" | ||
) { | ||
df => | ||
val smj = find(df.queryExecution.executedPlan) { | ||
case _: SortMergeJoinExecTransformer => true | ||
case _ => false | ||
} | ||
assert(smj.isDefined) | ||
val metrics = smj.get.metrics | ||
assert(metrics("numOutputRows").value == 100) | ||
assert(metrics("numOutputVectors").value > 0) | ||
assert(metrics("numOutputBytes").value > 0) | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 0 additions & 26 deletions
26
gluten-data/src/main/scala/io/glutenproject/metrics/SortMergeJoinMetricsUpdater.scala
This file was deleted.
Oops, something went wrong.