haziqishere commented on code in PR #7704:
URL: https://github.com/apache/datafusion-comet/pull/7704#discussion_r4652327232


##########
spark/src/main/scala/org/apache/comet/rules/EliminateRedundantTransitions.scala:
##########
@@ -176,6 +176,15 @@ case class EliminateRedundantTransitions(session: 
SparkSession)
             CometColumnarShuffle,
             _) =>
         s.withNewChildren(Seq(child))
+
+      // Spark also adds `RowToColumnar` even when comet chose native shuffle.
+      // Native shuffle reads only Comet vectors, not Spark's vectors.
+      // Switch to row and drop the transition.
+      case s @ CometShuffleExchangeExec(_, RowToColumnarExec(child), _, _, 
CometNativeShuffle, _)
+          if CometShuffleExchangeExec.columnarShuffleSupports(s, child) =>

Review Comment:
   Done in 2ec507084 (helper in 6b606b8b0). I also rename 
`columnarShuffleSupports` to -> `isColumnarShuffleSupported` as it sounds more 
descriptive.
   
   When the JVM columnar shuffle declines, a second arm keeps native shuffle 
and replaces `RowToColumnarExec` with `CometSparkToColumnarExec(child)`, 
guarded by `isNativeConversionSupported` 
(`CometSparkToColumnarExec.isSchemaSupported`). The JVM columnar shuffle stays 
the first choice. I left Celeborn out of the bridge since the Arrow stream 
input isn't verified there, so a Celeborn plan stays as it was and gets the new 
error.



##########
spark/src/main/scala/org/apache/comet/rules/EliminateRedundantTransitions.scala:
##########
@@ -176,6 +176,15 @@ case class EliminateRedundantTransitions(session: 
SparkSession)
             CometColumnarShuffle,
             _) =>
         s.withNewChildren(Seq(child))
+
+      // Spark also adds `RowToColumnar` even when comet chose native shuffle.
+      // Native shuffle reads only Comet vectors, not Spark's vectors.
+      // Switch to row and drop the transition.
+      case s @ CometShuffleExchangeExec(_, RowToColumnarExec(child), _, _, 
CometNativeShuffle, _)
+          if CometShuffleExchangeExec.columnarShuffleSupports(s, child) =>

Review Comment:
   Done in 2ec507084 (helper in 6b606b8b0). I also renamed 
`columnarShuffleSupports` to -> `isColumnarShuffleSupported` as it sounds more 
descriptive.
   
   When the JVM columnar shuffle declines, a second arm keeps native shuffle 
and replaces `RowToColumnarExec` with `CometSparkToColumnarExec(child)`, 
guarded by `isNativeConversionSupported` 
(`CometSparkToColumnarExec.isSchemaSupported`). The JVM columnar shuffle stays 
the first choice. I left Celeborn out of the bridge since the Arrow stream 
input isn't verified there, so a Celeborn plan stays as it was and gets the new 
error.



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