andygrove commented on code in PR #255:
URL:
https://github.com/apache/arrow-datafusion-comet/pull/255#discussion_r1560139497
##########
spark/src/main/scala/org/apache/comet/CometSparkSessionExtensions.scala:
##########
@@ -538,12 +659,47 @@ class CometSparkSessionExtensions
s
}
case None =>
- s
+ opWithInfo(s, info)
}
+ case s: ShuffleExchangeExec =>
+ val isShuffleEnabled = isCometShuffleEnabled(conf)
+ val msg1 = if (!isShuffleEnabled) {
+ CometExplainInfo("Native shuffle is not enabled")
+ } else {
+ CometExplainInfo.none
+ }
+ val columnarShuffleEnabled = isCometColumnarShuffleEnabled(conf)
+ val msg2 =
+ if (isShuffleEnabled && !columnarShuffleEnabled && !QueryPlanSerde
+ .supportPartitioning(s.child.output, s.outputPartitioning)
+ ._1) {
+ CometExplainInfo("Shuffle: " +
+ s"${QueryPlanSerde.supportPartitioning(s.child.output,
s.outputPartitioning)._2}")
+ } else {
+ CometExplainInfo.none
+ }
+ val msg3 =
+ if (isShuffleEnabled && columnarShuffleEnabled && !QueryPlanSerde
+ .supportPartitioningTypes(s.child.output, s.outputPartitioning)
+ ._1) {
+ val info =
+ QueryPlanSerde.supportPartitioningTypes(s.child.output,
s.outputPartitioning)._2
+ CometExplainInfo(s"Columnar shuffle: $info")
+ } else {
+ CometExplainInfo.none
+ }
+ opWithInfo(s, CometExplainInfo("BroadcastExchange", Seq(msg1, msg2,
msg3)))
+
case op =>
// An operator that is not supported by Comet
- op
+ op match {
+ case b: CometExec => b
+ case b: CometBroadcastExchangeExec => b
+ case b: CometShuffleExchangeExec => b
Review Comment:
very minor nit: we could combine these if we want to and avoid the extra
variable `b`.
```suggestion
case _: CometExec | _: CometBroadcastExchangeExec | _:
CometShuffleExchangeExec => op
```
--
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]