-
Notifications
You must be signed in to change notification settings - Fork 443
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[GLUTEN-7745][VL] Incorporate SQL Union operator into Velox execution pipeline #7842
Merged
Merged
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
8736e5b
fixup
zhztheplayer ce96179
fixup
zhztheplayer 2d8d331
fixup
zhztheplayer 67ed837
fixup
zhztheplayer c209bc7
fixup
zhztheplayer e6f1302
fixup
zhztheplayer 289d3a3
fixup
zhztheplayer 32d97a1
fixup
zhztheplayer 4b9f8a1
fixup
zhztheplayer 3ec878e
fixup
zhztheplayer a9b81f1
fixup
zhztheplayer a036ed3
fixup
zhztheplayer f0c0e4e
fixup
zhztheplayer 1365cb1
fixup
zhztheplayer a085e2f
fixup
zhztheplayer 594ca87
fixup
zhztheplayer 8921a0d
fixup
zhztheplayer cd3e456
fixup
zhztheplayer File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
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
35 changes: 35 additions & 0 deletions
35
backends-velox/src/main/scala/org/apache/gluten/metrics/UnionMetricsUpdater.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,35 @@ | ||
/* | ||
* 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.gluten.metrics | ||
|
||
import org.apache.spark.sql.execution.metric.SQLMetric | ||
|
||
class UnionMetricsUpdater(val metrics: Map[String, SQLMetric]) extends MetricsUpdater { | ||
override def updateNativeMetrics(opMetrics: IOperatorMetrics): Unit = { | ||
throw new UnsupportedOperationException() | ||
} | ||
|
||
def updateUnionMetrics(unionMetrics: java.util.ArrayList[OperatorMetrics]): Unit = { | ||
// Union was interpreted to LocalExchange + LocalPartition. Use metrics from LocalExchange. | ||
val localExchangeMetrics = unionMetrics.get(0) | ||
metrics("numInputRows") += localExchangeMetrics.inputRows | ||
metrics("inputVectors") += localExchangeMetrics.inputVectors | ||
metrics("inputBytes") += localExchangeMetrics.inputBytes | ||
metrics("cpuCount") += localExchangeMetrics.cpuCount | ||
metrics("wallNanos") += localExchangeMetrics.wallNanos | ||
} | ||
} |
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
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I found it's really painful to add new metrics in Gluten Velox backend. There is a set of metrics from Velox query plan being converted to a tree or an array again and again during passing to Spark Java side. A lot of magical IDs are used during the tree / array traversal algorithms with a lot of special handling of corner cases, e.g., join, filter project, and union which is added in this PR.
The whole metric system should be reworked (if someone could lead this work) otherwise it's unmaintainable.