You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@gluten.apache.org by "acvictor (via GitHub)" <gi...@apache.org> on 2024/06/07 15:19:13 UTC

[PR] Use SortShuffleManager instance in ColumnarShuffleManager [incubator-gluten]

acvictor opened a new pull request, #6022:
URL: https://github.com/apache/incubator-gluten/pull/6022

   ## What changes were proposed in this pull request?
   
   (Please fill in changes proposed in this fix)
   
   (Fixes: \#ISSUE-ID)
   
   ## How was this patch tested?
   
   (Please explain how this patch was tested. E.g. unit tests, integration tests, manual tests)
   
   
   (If this patch involves UI changes, please attach a screenshot; otherwise, remove this)
   
   


-- 
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: commits-unsubscribe@gluten.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org


Re: [PR] Use SortShuffleManager instance in ColumnarShuffleManager [incubator-gluten]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #6022:
URL: https://github.com/apache/incubator-gluten/pull/6022#issuecomment-2155057016

   Run Gluten Clickhouse CI


-- 
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: commits-unsubscribe@gluten.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org


Re: [PR] [CORE] Use SortShuffleManager instance in ColumnarShuffleManager [incubator-gluten]

Posted by "marin-ma (via GitHub)" <gi...@apache.org>.
marin-ma commented on code in PR #6022:
URL: https://github.com/apache/incubator-gluten/pull/6022#discussion_r1635832795


##########
backends-velox/src/test/scala/org/apache/gluten/execution/FallbackSuite.scala:
##########
@@ -71,6 +71,23 @@ class FallbackSuite extends VeloxWholeStageTransformerSuite with AdaptiveSparkPl
     collect(plan) { case v: VeloxColumnarToRowExec => v }.size
   }
 
+  test("fallback with shuffle manager") {
+    withSQLConf(GlutenConfig.COLUMNAR_SHUFFLE_ENABLED.key -> "false") {
+      runQueryAndCompare("select c1, count(*) from tmp1 group by c1") {
+        df =>
+          val plan = df.queryExecution.executedPlan
+          val columnarShuffle = find(plan) {
+            case _: ColumnarShuffledJoin => true

Review Comment:
   We should check the number of`ColumnarShuffleExchangeExec` and `ShuffleExchangeExec`. You can use repartition hint to construct the sql https://spark.apache.org/docs/latest/sql-ref-syntax-qry-select-hints.html#partitioning-hints
   
   e.g. `select /*+ REPARTITION(3, c1) */ * FROM tmp1;`
   
   Then the check should be like:
   
   ```
   assert(collectColumnarShuffleExchange(plan) == 0)
   assert(collectShuffleExchange(plan) == 1)
   ```



-- 
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: commits-unsubscribe@gluten.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org


Re: [PR] [CORE] Use SortShuffleManager instance in ColumnarShuffleManager [incubator-gluten]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #6022:
URL: https://github.com/apache/incubator-gluten/pull/6022#issuecomment-2162148467

   Run Gluten Clickhouse CI


-- 
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: commits-unsubscribe@gluten.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org


Re: [PR] [CORE] Use SortShuffleManager instance in ColumnarShuffleManager [incubator-gluten]

Posted by "ulysses-you (via GitHub)" <gi...@apache.org>.
ulysses-you commented on PR #6022:
URL: https://github.com/apache/incubator-gluten/pull/6022#issuecomment-2160359783

   shall we call `unregisterShuffle` and `stop` if it is delegated to sort shuffle manager ?


-- 
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: commits-unsubscribe@gluten.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org


Re: [PR] [CORE] Use SortShuffleManager instance in ColumnarShuffleManager [incubator-gluten]

Posted by "marin-ma (via GitHub)" <gi...@apache.org>.
marin-ma commented on PR #6022:
URL: https://github.com/apache/incubator-gluten/pull/6022#issuecomment-2161964551

   @ulysses-you Thanks for review!
   
   @acvictor Could you help to add a UT to test the fallback behavior for columnar shuffle? Perhaps, add one test case in `FallbackSuite.scala` and set `spark.gluten.sql.columnar.shuffle=false` force the Exchange operator to fall back


-- 
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: commits-unsubscribe@gluten.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org


Re: [PR] [CORE] Use SortShuffleManager instance in ColumnarShuffleManager [incubator-gluten]

Posted by "marin-ma (via GitHub)" <gi...@apache.org>.
marin-ma commented on code in PR #6022:
URL: https://github.com/apache/incubator-gluten/pull/6022#discussion_r1635846865


##########
backends-velox/src/test/scala/org/apache/gluten/execution/FallbackSuite.scala:
##########
@@ -71,6 +71,23 @@ class FallbackSuite extends VeloxWholeStageTransformerSuite with AdaptiveSparkPl
     collect(plan) { case v: VeloxColumnarToRowExec => v }.size
   }
 
+  test("fallback with shuffle manager") {
+    withSQLConf(GlutenConfig.COLUMNAR_SHUFFLE_ENABLED.key -> "false") {
+      runQueryAndCompare("select c1, count(*) from tmp1 group by c1") {
+        df =>
+          val plan = df.queryExecution.executedPlan
+          val columnarShuffle = find(plan) {
+            case _: ColumnarShuffledJoin => true

Review Comment:
   It's ok to me. Thanks.



-- 
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: commits-unsubscribe@gluten.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org


Re: [PR] [CORE] Use SortShuffleManager instance in ColumnarShuffleManager [incubator-gluten]

Posted by "acvictor (via GitHub)" <gi...@apache.org>.
acvictor commented on PR #6022:
URL: https://github.com/apache/incubator-gluten/pull/6022#issuecomment-2162954187

   @marin-ma added a test.


-- 
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: commits-unsubscribe@gluten.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org


Re: [PR] [CORE] Use SortShuffleManager instance in ColumnarShuffleManager [incubator-gluten]

Posted by "acvictor (via GitHub)" <gi...@apache.org>.
acvictor commented on code in PR #6022:
URL: https://github.com/apache/incubator-gluten/pull/6022#discussion_r1634250882


##########
gluten-core/src/main/scala/org/apache/spark/shuffle/sort/ColumnarShuffleManager.scala:
##########
@@ -20,21 +20,19 @@ import org.apache.spark.{ShuffleDependency, SparkConf, SparkEnv, TaskContext}
 import org.apache.spark.internal.Logging
 import org.apache.spark.serializer.SerializerManager
 import org.apache.spark.shuffle._
-import org.apache.spark.shuffle.api.ShuffleExecutorComponents
 import org.apache.spark.shuffle.sort.SortShuffleManager.canUseBatchFetch
 import org.apache.spark.storage.BlockId
 import org.apache.spark.util.collection.OpenHashSet
 
 import java.io.InputStream
 import java.util.concurrent.ConcurrentHashMap
 
-import scala.collection.JavaConverters._
-
 class ColumnarShuffleManager(conf: SparkConf) extends ShuffleManager with Logging {
 
   import ColumnarShuffleManager._
 
-  private lazy val shuffleExecutorComponents = loadShuffleExecutorComponents(conf)
+  private[this] val sortShuffleManager: SortShuffleManager = new SortShuffleManager(conf)

Review Comment:
   Updated.



-- 
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: commits-unsubscribe@gluten.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org


Re: [PR] [CORE] Use SortShuffleManager instance in ColumnarShuffleManager [incubator-gluten]

Posted by "ulysses-you (via GitHub)" <gi...@apache.org>.
ulysses-you commented on code in PR #6022:
URL: https://github.com/apache/incubator-gluten/pull/6022#discussion_r1634583569


##########
gluten-core/src/main/scala/org/apache/spark/shuffle/sort/ColumnarShuffleManager.scala:
##########
@@ -143,13 +107,14 @@ class ColumnarShuffleManager(conf: SparkConf) extends ShuffleManager with Loggin
         shouldBatchFetch = shouldBatchFetch

Review Comment:
   shall we move line90-99 to line101 ?



-- 
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: commits-unsubscribe@gluten.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org


Re: [PR] Use SortShuffleManager instance in ColumnarShuffleManager [incubator-gluten]

Posted by "acvictor (via GitHub)" <gi...@apache.org>.
acvictor commented on PR #6022:
URL: https://github.com/apache/incubator-gluten/pull/6022#issuecomment-2155844411

   @marin-ma can you please review this? Thank you!


-- 
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: commits-unsubscribe@gluten.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org


Re: [PR] [CORE] Use SortShuffleManager instance in ColumnarShuffleManager [incubator-gluten]

Posted by "acvictor (via GitHub)" <gi...@apache.org>.
acvictor commented on PR #6022:
URL: https://github.com/apache/incubator-gluten/pull/6022#issuecomment-2160220609

   @ulysses-you can you please review again? Thank you!


-- 
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: commits-unsubscribe@gluten.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org


Re: [PR] [CORE] Use SortShuffleManager instance in ColumnarShuffleManager [incubator-gluten]

Posted by "acvictor (via GitHub)" <gi...@apache.org>.
acvictor commented on code in PR #6022:
URL: https://github.com/apache/incubator-gluten/pull/6022#discussion_r1634613056


##########
gluten-core/src/main/scala/org/apache/spark/shuffle/sort/ColumnarShuffleManager.scala:
##########
@@ -80,34 +64,14 @@ class ColumnarShuffleManager(conf: SparkConf) extends ShuffleManager with Loggin
     mapTaskIds.synchronized {
       mapTaskIds.add(context.taskAttemptId())
     }

Review Comment:
   Moved to `case columnarShuffleHandle: ColumnarShuffleHandle`



##########
gluten-core/src/main/scala/org/apache/spark/shuffle/sort/ColumnarShuffleManager.scala:
##########
@@ -143,13 +107,14 @@ class ColumnarShuffleManager(conf: SparkConf) extends ShuffleManager with Loggin
         shouldBatchFetch = shouldBatchFetch

Review Comment:
   Updated.



-- 
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: commits-unsubscribe@gluten.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org


Re: [PR] [CORE] Use SortShuffleManager instance in ColumnarShuffleManager [incubator-gluten]

Posted by "acvictor (via GitHub)" <gi...@apache.org>.
acvictor commented on code in PR #6022:
URL: https://github.com/apache/incubator-gluten/pull/6022#discussion_r1634251258


##########
gluten-core/src/main/scala/org/apache/spark/shuffle/sort/ColumnarShuffleManager.scala:
##########
@@ -143,44 +107,29 @@ class ColumnarShuffleManager(conf: SparkConf) extends ShuffleManager with Loggin
         shouldBatchFetch = shouldBatchFetch
       )
     } else {
-      new BlockStoreShuffleReader(
-        handle.asInstanceOf[BaseShuffleHandle[K, _, C]],
-        blocksByAddress,
+      sortShuffleManager.getReader(
+        handle,
+        startMapIndex,
+        endMapIndex,
+        startPartition,
+        endPartition,
         context,
-        metrics,
-        shouldBatchFetch = shouldBatchFetch
-      )
+        metrics)
     }
   }
 
   /** Remove a shuffle's metadata from the ShuffleManager. */
   override def unregisterShuffle(shuffleId: Int): Boolean = {
-    Option(taskIdMapsForShuffle.remove(shuffleId)).foreach {
-      mapTaskIds =>
-        mapTaskIds.iterator.foreach {
-          mapId => shuffleBlockResolver.removeDataByMap(shuffleId, mapId)
-        }
-    }
-    true
+    sortShuffleManager.unregisterShuffle(shuffleId)

Review Comment:
   I missed this thanks, updated shuffleBlockResolver related flow.



-- 
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: commits-unsubscribe@gluten.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org


Re: [PR] [CORE] Use SortShuffleManager instance in ColumnarShuffleManager [incubator-gluten]

Posted by "ulysses-you (via GitHub)" <gi...@apache.org>.
ulysses-you commented on code in PR #6022:
URL: https://github.com/apache/incubator-gluten/pull/6022#discussion_r1634581707


##########
gluten-core/src/main/scala/org/apache/spark/shuffle/sort/ColumnarShuffleManager.scala:
##########
@@ -80,34 +64,14 @@ class ColumnarShuffleManager(conf: SparkConf) extends ShuffleManager with Loggin
     mapTaskIds.synchronized {
       mapTaskIds.add(context.taskAttemptId())
     }

Review Comment:
   Shall we move this code in ` case columnarShuffleHandle: ColumnarShuffleHandle` ?



-- 
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: commits-unsubscribe@gluten.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org


Re: [PR] [CORE] Use SortShuffleManager instance in ColumnarShuffleManager [incubator-gluten]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #6022:
URL: https://github.com/apache/incubator-gluten/pull/6022#issuecomment-2158294382

   Run Gluten Clickhouse CI


-- 
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: commits-unsubscribe@gluten.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org


Re: [PR] [CORE] Use SortShuffleManager instance in ColumnarShuffleManager [incubator-gluten]

Posted by "acvictor (via GitHub)" <gi...@apache.org>.
acvictor commented on PR #6022:
URL: https://github.com/apache/incubator-gluten/pull/6022#issuecomment-2157309872

   @rui-mo can you too please review this? Thanks!


-- 
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: commits-unsubscribe@gluten.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org


Re: [PR] Use SortShuffleManager instance in ColumnarShuffleManager [incubator-gluten]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #6022:
URL: https://github.com/apache/incubator-gluten/pull/6022#issuecomment-2155054887

   <!--
     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/LICEGJ-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.
   -->
   
   Thanks for opening a pull request!
   
   Could you open an issue for this pull request on Github Issues?
   
   https://github.com/apache/incubator-gluten/issues
   
   Then could you also rename ***commit message*** and ***pull request title*** in the following format?
   
       [GLUTEN-${ISSUES_ID}][COMPONENT]feat/fix: ${detailed message}
   
   See also:
   
     * [Other pull requests](https://github.com/apache/incubator-gluten/pulls/)
   
   


-- 
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: commits-unsubscribe@gluten.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org


Re: [PR] [CORE] Use SortShuffleManager instance in ColumnarShuffleManager [incubator-gluten]

Posted by "marin-ma (via GitHub)" <gi...@apache.org>.
marin-ma merged PR #6022:
URL: https://github.com/apache/incubator-gluten/pull/6022


-- 
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: commits-unsubscribe@gluten.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org


Re: [PR] [CORE] Use SortShuffleManager instance in ColumnarShuffleManager [incubator-gluten]

Posted by "acvictor (via GitHub)" <gi...@apache.org>.
acvictor commented on code in PR #6022:
URL: https://github.com/apache/incubator-gluten/pull/6022#discussion_r1634251475


##########
gluten-core/src/main/scala/org/apache/spark/shuffle/sort/ColumnarShuffleManager.scala:
##########
@@ -143,44 +107,29 @@ class ColumnarShuffleManager(conf: SparkConf) extends ShuffleManager with Loggin
         shouldBatchFetch = shouldBatchFetch
       )
     } else {
-      new BlockStoreShuffleReader(
-        handle.asInstanceOf[BaseShuffleHandle[K, _, C]],
-        blocksByAddress,
+      sortShuffleManager.getReader(
+        handle,
+        startMapIndex,
+        endMapIndex,
+        startPartition,
+        endPartition,
         context,
-        metrics,
-        shouldBatchFetch = shouldBatchFetch
-      )
+        metrics)
     }
   }
 
   /** Remove a shuffle's metadata from the ShuffleManager. */
   override def unregisterShuffle(shuffleId: Int): Boolean = {
-    Option(taskIdMapsForShuffle.remove(shuffleId)).foreach {
-      mapTaskIds =>
-        mapTaskIds.iterator.foreach {
-          mapId => shuffleBlockResolver.removeDataByMap(shuffleId, mapId)
-        }
-    }
-    true
+    sortShuffleManager.unregisterShuffle(shuffleId)
   }
 
   /** Shut down this ShuffleManager. */
   override def stop(): Unit = {
-    shuffleBlockResolver.stop()
+    sortShuffleManager.stop()

Review Comment:
   Updated, thanks!



-- 
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: commits-unsubscribe@gluten.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org


Re: [PR] [CORE] Use SortShuffleManager instance in ColumnarShuffleManager [incubator-gluten]

Posted by "ulysses-you (via GitHub)" <gi...@apache.org>.
ulysses-you commented on code in PR #6022:
URL: https://github.com/apache/incubator-gluten/pull/6022#discussion_r1634039708


##########
gluten-core/src/main/scala/org/apache/spark/shuffle/sort/ColumnarShuffleManager.scala:
##########
@@ -20,21 +20,19 @@ import org.apache.spark.{ShuffleDependency, SparkConf, SparkEnv, TaskContext}
 import org.apache.spark.internal.Logging
 import org.apache.spark.serializer.SerializerManager
 import org.apache.spark.shuffle._
-import org.apache.spark.shuffle.api.ShuffleExecutorComponents
 import org.apache.spark.shuffle.sort.SortShuffleManager.canUseBatchFetch
 import org.apache.spark.storage.BlockId
 import org.apache.spark.util.collection.OpenHashSet
 
 import java.io.InputStream
 import java.util.concurrent.ConcurrentHashMap
 
-import scala.collection.JavaConverters._
-
 class ColumnarShuffleManager(conf: SparkConf) extends ShuffleManager with Logging {
 
   import ColumnarShuffleManager._
 
-  private lazy val shuffleExecutorComponents = loadShuffleExecutorComponents(conf)
+  private[this] val sortShuffleManager: SortShuffleManager = new SortShuffleManager(conf)

Review Comment:
   `lazy` ?



-- 
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: commits-unsubscribe@gluten.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org


Re: [PR] [CORE] Use SortShuffleManager instance in ColumnarShuffleManager [incubator-gluten]

Posted by "acvictor (via GitHub)" <gi...@apache.org>.
acvictor commented on PR #6022:
URL: https://github.com/apache/incubator-gluten/pull/6022#issuecomment-2160401652

   > shall we call `unregisterShuffle` and `stop` if it is delegated to sort shuffle manager ? e.g.,
   > 
   > ```
   > if (taskIdMapsForShuffle.contains(shuffleId)) {
   >   this.stop
   > } else {
   >   delegated.stop
   > }
   > ```
   
   Updated `unregisterShuffle` and `stop` to this pattern.


-- 
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: commits-unsubscribe@gluten.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org


Re: [PR] [CORE] Use SortShuffleManager instance in ColumnarShuffleManager [incubator-gluten]

Posted by "acvictor (via GitHub)" <gi...@apache.org>.
acvictor commented on PR #6022:
URL: https://github.com/apache/incubator-gluten/pull/6022#issuecomment-2160443858

   Thank you @ulysses-you for the comments! Updated the PR.


-- 
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: commits-unsubscribe@gluten.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org


Re: [PR] Use SortShuffleManager instance in ColumnarShuffleManager [incubator-gluten]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #6022:
URL: https://github.com/apache/incubator-gluten/pull/6022#issuecomment-2155055291

   Run Gluten Clickhouse CI


-- 
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: commits-unsubscribe@gluten.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org


Re: [PR] Use SortShuffleManager instance in ColumnarShuffleManager [incubator-gluten]

Posted by "acvictor (via GitHub)" <gi...@apache.org>.
acvictor commented on PR #6022:
URL: https://github.com/apache/incubator-gluten/pull/6022#issuecomment-2155807636

   /Benchmark Velox


-- 
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: commits-unsubscribe@gluten.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org


Re: [PR] [CORE] Use SortShuffleManager instance in ColumnarShuffleManager [incubator-gluten]

Posted by "ulysses-you (via GitHub)" <gi...@apache.org>.
ulysses-you commented on code in PR #6022:
URL: https://github.com/apache/incubator-gluten/pull/6022#discussion_r1634042870


##########
gluten-core/src/main/scala/org/apache/spark/shuffle/sort/ColumnarShuffleManager.scala:
##########
@@ -143,44 +107,29 @@ class ColumnarShuffleManager(conf: SparkConf) extends ShuffleManager with Loggin
         shouldBatchFetch = shouldBatchFetch
       )
     } else {
-      new BlockStoreShuffleReader(
-        handle.asInstanceOf[BaseShuffleHandle[K, _, C]],
-        blocksByAddress,
+      sortShuffleManager.getReader(
+        handle,
+        startMapIndex,
+        endMapIndex,
+        startPartition,
+        endPartition,
         context,
-        metrics,
-        shouldBatchFetch = shouldBatchFetch
-      )
+        metrics)
     }
   }
 
   /** Remove a shuffle's metadata from the ShuffleManager. */
   override def unregisterShuffle(shuffleId: Int): Boolean = {
-    Option(taskIdMapsForShuffle.remove(shuffleId)).foreach {
-      mapTaskIds =>
-        mapTaskIds.iterator.foreach {
-          mapId => shuffleBlockResolver.removeDataByMap(shuffleId, mapId)
-        }
-    }
-    true
+    sortShuffleManager.unregisterShuffle(shuffleId)

Review Comment:
   Does it same with before ? The `taskIdMapsForShuffle` is maintained by `ColumnarShuffleManager` so `sortShuffleManager. unregisterShuffle` will do nothing since the `taskIdMapsForShuffle` is empty.



-- 
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: commits-unsubscribe@gluten.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org


Re: [PR] [CORE] Use SortShuffleManager instance in ColumnarShuffleManager [incubator-gluten]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #6022:
URL: https://github.com/apache/incubator-gluten/pull/6022#issuecomment-2162125017

   Run Gluten Clickhouse CI


-- 
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: commits-unsubscribe@gluten.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org


Re: [PR] [CORE] Use SortShuffleManager instance in ColumnarShuffleManager [incubator-gluten]

Posted by "GlutenPerfBot (via GitHub)" <gi...@apache.org>.
GlutenPerfBot commented on PR #6022:
URL: https://github.com/apache/incubator-gluten/pull/6022#issuecomment-2164223570

   ===== Performance report for TPCH SF2000 with Velox backend, for reference only ====
   <table border="1" cellpadding="0" cellspacing="0">
                   <tbody>
                       <tr>
                               <td><font color=#000000>query</font></td>
                               <td><font color=#000000>log/native_6022_time.csv</font></td>
                               <td><font color=#000000>log/native_master_06_12_2024_7445f02c9_time.csv</font></td>
                               <td><font color=#000000>difference</font></td>
                               <td><font color=#000000>percentage</font></td>
                       </tr>
                       <tr>
                               <td><font color=#6F9915>q1</font></td>
                               <td><font color=#6F9915>35.67</font></td>
                               <td><font color=#6F9915>33.87</font></td>
                               <td><font color=#6F9915>-1.796</font></td>
                               <td><font color=#6F9915>94.96%</font></td>
                       </tr>
                       <tr>
                               <td><font color=#F92663>q2</font></td>
                               <td><font color=#F92663>23.60</font></td>
                               <td><font color=#F92663>26.51</font></td>
                               <td><font color=#F92663>2.905</font></td>
                               <td><font color=#F92663>112.31%</font></td>
                       </tr>
                       <tr>
                               <td><font color=#F92663>q3</font></td>
                               <td><font color=#F92663>36.84</font></td>
                               <td><font color=#F92663>36.94</font></td>
                               <td><font color=#F92663>0.106</font></td>
                               <td><font color=#F92663>100.29%</font></td>
                       </tr>
                       <tr>
                               <td><font color=#F92663>q4</font></td>
                               <td><font color=#F92663>32.41</font></td>
                               <td><font color=#F92663>34.65</font></td>
                               <td><font color=#F92663>2.244</font></td>
                               <td><font color=#F92663>106.93%</font></td>
                       </tr>
                       <tr>
                               <td><font color=#6F9915>q5</font></td>
                               <td><font color=#6F9915>70.83</font></td>
                               <td><font color=#6F9915>69.47</font></td>
                               <td><font color=#6F9915>-1.358</font></td>
                               <td><font color=#6F9915>98.08%</font></td>
                       </tr>
                       <tr>
                               <td><font color=#6F9915>q6</font></td>
                               <td><font color=#6F9915>7.61</font></td>
                               <td><font color=#6F9915>5.84</font></td>
                               <td><font color=#6F9915>-1.772</font></td>
                               <td><font color=#6F9915>76.72%</font></td>
                       </tr>
                       <tr>
                               <td><font color=#6F9915>q7</font></td>
                               <td><font color=#6F9915>84.08</font></td>
                               <td><font color=#6F9915>82.18</font></td>
                               <td><font color=#6F9915>-1.901</font></td>
                               <td><font color=#6F9915>97.74%</font></td>
                       </tr>
                       <tr>
                               <td><font color=#F92663>q8</font></td>
                               <td><font color=#F92663>83.77</font></td>
                               <td><font color=#F92663>85.19</font></td>
                               <td><font color=#F92663>1.414</font></td>
                               <td><font color=#F92663>101.69%</font></td>
                       </tr>
                       <tr>
                               <td><font color=#F92663>q9</font></td>
                               <td><font color=#F92663>118.64</font></td>
                               <td><font color=#F92663>120.19</font></td>
                               <td><font color=#F92663>1.543</font></td>
                               <td><font color=#F92663>101.30%</font></td>
                       </tr>
                       <tr>
                               <td><font color=#6F9915>q10</font></td>
                               <td><font color=#6F9915>44.72</font></td>
                               <td><font color=#6F9915>43.54</font></td>
                               <td><font color=#6F9915>-1.180</font></td>
                               <td><font color=#6F9915>97.36%</font></td>
                       </tr>
                       <tr>
                               <td><font color=#6F9915>q11</font></td>
                               <td><font color=#6F9915>22.67</font></td>
                               <td><font color=#6F9915>20.47</font></td>
                               <td><font color=#6F9915>-2.197</font></td>
                               <td><font color=#6F9915>90.31%</font></td>
                       </tr>
                       <tr>
                               <td><font color=#6F9915>q12</font></td>
                               <td><font color=#6F9915>26.37</font></td>
                               <td><font color=#6F9915>24.09</font></td>
                               <td><font color=#6F9915>-2.280</font></td>
                               <td><font color=#6F9915>91.35%</font></td>
                       </tr>
                       <tr>
                               <td><font color=#6F9915>q13</font></td>
                               <td><font color=#6F9915>37.56</font></td>
                               <td><font color=#6F9915>37.22</font></td>
                               <td><font color=#6F9915>-0.342</font></td>
                               <td><font color=#6F9915>99.09%</font></td>
                       </tr>
                       <tr>
                               <td><font color=#F92663>q14</font></td>
                               <td><font color=#F92663>19.24</font></td>
                               <td><font color=#F92663>23.00</font></td>
                               <td><font color=#F92663>3.754</font></td>
                               <td><font color=#F92663>119.51%</font></td>
                       </tr>
                       <tr>
                               <td><font color=#F92663>q15</font></td>
                               <td><font color=#F92663>30.13</font></td>
                               <td><font color=#F92663>30.20</font></td>
                               <td><font color=#F92663>0.073</font></td>
                               <td><font color=#F92663>100.24%</font></td>
                       </tr>
                       <tr>
                               <td><font color=#F92663>q16</font></td>
                               <td><font color=#F92663>13.74</font></td>
                               <td><font color=#F92663>13.79</font></td>
                               <td><font color=#F92663>0.047</font></td>
                               <td><font color=#F92663>100.34%</font></td>
                       </tr>
                       <tr>
                               <td><font color=#6F9915>q17</font></td>
                               <td><font color=#6F9915>103.62</font></td>
                               <td><font color=#6F9915>102.85</font></td>
                               <td><font color=#6F9915>-0.770</font></td>
                               <td><font color=#6F9915>99.26%</font></td>
                       </tr>
                       <tr>
                               <td><font color=#F92663>q18</font></td>
                               <td><font color=#F92663>143.92</font></td>
                               <td><font color=#F92663>145.02</font></td>
                               <td><font color=#F92663>1.098</font></td>
                               <td><font color=#F92663>100.76%</font></td>
                       </tr>
                       <tr>
                               <td><font color=#F92663>q19</font></td>
                               <td><font color=#F92663>13.62</font></td>
                               <td><font color=#F92663>16.14</font></td>
                               <td><font color=#F92663>2.518</font></td>
                               <td><font color=#F92663>118.49%</font></td>
                       </tr>
                       <tr>
                               <td><font color=#6F9915>q20</font></td>
                               <td><font color=#6F9915>29.19</font></td>
                               <td><font color=#6F9915>27.34</font></td>
                               <td><font color=#6F9915>-1.848</font></td>
                               <td><font color=#6F9915>93.67%</font></td>
                       </tr>
                       <tr>
                               <td><font color=#F92663>q21</font></td>
                               <td><font color=#F92663>262.53</font></td>
                               <td><font color=#F92663>263.30</font></td>
                               <td><font color=#F92663>0.765</font></td>
                               <td><font color=#F92663>100.29%</font></td>
                       </tr>
                       <tr>
                               <td><font color=#6F9915>q22</font></td>
                               <td><font color=#6F9915>12.33</font></td>
                               <td><font color=#6F9915>12.08</font></td>
                               <td><font color=#6F9915>-0.247</font></td>
                               <td><font color=#6F9915>98.00%</font></td>
                       </tr>
                       <tr>
                               <td><font color=#F92663>total</font></td>
                               <td><font color=#F92663>1253.09</font></td>
                               <td><font color=#F92663>1253.86</font></td>
                               <td><font color=#F92663>0.775</font></td>
                               <td><font color=#F92663>100.06%</font></td>
                       </tr>
                   </tbody>
               </table>


-- 
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: commits-unsubscribe@gluten.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org


Re: [PR] [CORE] Use SortShuffleManager instance in ColumnarShuffleManager [incubator-gluten]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #6022:
URL: https://github.com/apache/incubator-gluten/pull/6022#issuecomment-2162530537

   Run Gluten Clickhouse CI


-- 
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: commits-unsubscribe@gluten.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org


Re: [PR] [CORE] Use SortShuffleManager instance in ColumnarShuffleManager [incubator-gluten]

Posted by "ulysses-you (via GitHub)" <gi...@apache.org>.
ulysses-you commented on code in PR #6022:
URL: https://github.com/apache/incubator-gluten/pull/6022#discussion_r1634044888


##########
gluten-core/src/main/scala/org/apache/spark/shuffle/sort/ColumnarShuffleManager.scala:
##########
@@ -143,44 +107,29 @@ class ColumnarShuffleManager(conf: SparkConf) extends ShuffleManager with Loggin
         shouldBatchFetch = shouldBatchFetch
       )
     } else {
-      new BlockStoreShuffleReader(
-        handle.asInstanceOf[BaseShuffleHandle[K, _, C]],
-        blocksByAddress,
+      sortShuffleManager.getReader(
+        handle,
+        startMapIndex,
+        endMapIndex,
+        startPartition,
+        endPartition,
         context,
-        metrics,
-        shouldBatchFetch = shouldBatchFetch
-      )
+        metrics)
     }
   }
 
   /** Remove a shuffle's metadata from the ShuffleManager. */
   override def unregisterShuffle(shuffleId: Int): Boolean = {
-    Option(taskIdMapsForShuffle.remove(shuffleId)).foreach {
-      mapTaskIds =>
-        mapTaskIds.iterator.foreach {
-          mapId => shuffleBlockResolver.removeDataByMap(shuffleId, mapId)
-        }
-    }
-    true
+    sortShuffleManager.unregisterShuffle(shuffleId)
   }
 
   /** Shut down this ShuffleManager. */
   override def stop(): Unit = {
-    shuffleBlockResolver.stop()
+    sortShuffleManager.stop()

Review Comment:
   The shuffleBlockResolver is hold in `ColumnarShuffleManager`, how can `SortShuffleManager` stop it?



-- 
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: commits-unsubscribe@gluten.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org


Re: [PR] [CORE] Use SortShuffleManager instance in ColumnarShuffleManager [incubator-gluten]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #6022:
URL: https://github.com/apache/incubator-gluten/pull/6022#issuecomment-2159871850

   Run Gluten Clickhouse CI


-- 
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: commits-unsubscribe@gluten.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org


Re: [PR] [CORE] Use SortShuffleManager instance in ColumnarShuffleManager [incubator-gluten]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #6022:
URL: https://github.com/apache/incubator-gluten/pull/6022#issuecomment-2160398804

   Run Gluten Clickhouse CI


-- 
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: commits-unsubscribe@gluten.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org


Re: [PR] Use SortShuffleManager instance in ColumnarShuffleManager [incubator-gluten]

Posted by "GlutenPerfBot (via GitHub)" <gi...@apache.org>.
GlutenPerfBot commented on PR #6022:
URL: https://github.com/apache/incubator-gluten/pull/6022#issuecomment-2155829236

   ===== Performance report for TPCH SF2000 with Velox backend, for reference only ====
   <table border="1" cellpadding="0" cellspacing="0">
                   <tbody>
                       <tr>
                               <td><font color=#000000>query</font></td>
                               <td><font color=#000000>log/native_6022_time.csv</font></td>
                               <td><font color=#000000>log/native_master_06_07_2024_85e8619f12_time.csv</font></td>
                               <td><font color=#000000>difference</font></td>
                               <td><font color=#000000>percentage</font></td>
                       </tr>
                       <tr>
                               <td><font color=#F92663>q1</font></td>
                               <td><font color=#F92663>34.16</font></td>
                               <td><font color=#F92663>34.74</font></td>
                               <td><font color=#F92663>0.584</font></td>
                               <td><font color=#F92663>101.71%</font></td>
                       </tr>
                       <tr>
                               <td><font color=#6F9915>q2</font></td>
                               <td><font color=#6F9915>24.59</font></td>
                               <td><font color=#6F9915>23.82</font></td>
                               <td><font color=#6F9915>-0.776</font></td>
                               <td><font color=#6F9915>96.84%</font></td>
                       </tr>
                       <tr>
                               <td><font color=#F92663>q3</font></td>
                               <td><font color=#F92663>36.75</font></td>
                               <td><font color=#F92663>37.27</font></td>
                               <td><font color=#F92663>0.519</font></td>
                               <td><font color=#F92663>101.41%</font></td>
                       </tr>
                       <tr>
                               <td><font color=#6F9915>q4</font></td>
                               <td><font color=#6F9915>33.86</font></td>
                               <td><font color=#6F9915>30.13</font></td>
                               <td><font color=#6F9915>-3.731</font></td>
                               <td><font color=#6F9915>88.98%</font></td>
                       </tr>
                       <tr>
                               <td><font color=#F92663>q5</font></td>
                               <td><font color=#F92663>69.01</font></td>
                               <td><font color=#F92663>70.45</font></td>
                               <td><font color=#F92663>1.446</font></td>
                               <td><font color=#F92663>102.10%</font></td>
                       </tr>
                       <tr>
                               <td><font color=#6F9915>q6</font></td>
                               <td><font color=#6F9915>7.55</font></td>
                               <td><font color=#6F9915>7.45</font></td>
                               <td><font color=#6F9915>-0.101</font></td>
                               <td><font color=#6F9915>98.66%</font></td>
                       </tr>
                       <tr>
                               <td><font color=#F92663>q7</font></td>
                               <td><font color=#F92663>81.89</font></td>
                               <td><font color=#F92663>83.57</font></td>
                               <td><font color=#F92663>1.676</font></td>
                               <td><font color=#F92663>102.05%</font></td>
                       </tr>
                       <tr>
                               <td><font color=#6F9915>q8</font></td>
                               <td><font color=#6F9915>87.32</font></td>
                               <td><font color=#6F9915>86.74</font></td>
                               <td><font color=#6F9915>-0.576</font></td>
                               <td><font color=#6F9915>99.34%</font></td>
                       </tr>
                       <tr>
                               <td><font color=#F92663>q9</font></td>
                               <td><font color=#F92663>121.00</font></td>
                               <td><font color=#F92663>121.95</font></td>
                               <td><font color=#F92663>0.949</font></td>
                               <td><font color=#F92663>100.78%</font></td>
                       </tr>
                       <tr>
                               <td><font color=#6F9915>q10</font></td>
                               <td><font color=#6F9915>45.90</font></td>
                               <td><font color=#6F9915>45.15</font></td>
                               <td><font color=#6F9915>-0.754</font></td>
                               <td><font color=#6F9915>98.36%</font></td>
                       </tr>
                       <tr>
                               <td><font color=#6F9915>q11</font></td>
                               <td><font color=#6F9915>23.86</font></td>
                               <td><font color=#6F9915>19.51</font></td>
                               <td><font color=#6F9915>-4.357</font></td>
                               <td><font color=#6F9915>81.74%</font></td>
                       </tr>
                       <tr>
                               <td><font color=#F92663>q12</font></td>
                               <td><font color=#F92663>26.61</font></td>
                               <td><font color=#F92663>26.76</font></td>
                               <td><font color=#F92663>0.152</font></td>
                               <td><font color=#F92663>100.57%</font></td>
                       </tr>
                       <tr>
                               <td><font color=#F92663>q13</font></td>
                               <td><font color=#F92663>37.99</font></td>
                               <td><font color=#F92663>39.39</font></td>
                               <td><font color=#F92663>1.408</font></td>
                               <td><font color=#F92663>103.71%</font></td>
                       </tr>
                       <tr>
                               <td><font color=#6F9915>q14</font></td>
                               <td><font color=#6F9915>21.04</font></td>
                               <td><font color=#6F9915>20.54</font></td>
                               <td><font color=#6F9915>-0.499</font></td>
                               <td><font color=#6F9915>97.63%</font></td>
                       </tr>
                       <tr>
                               <td><font color=#6F9915>q15</font></td>
                               <td><font color=#6F9915>31.63</font></td>
                               <td><font color=#6F9915>31.52</font></td>
                               <td><font color=#6F9915>-0.105</font></td>
                               <td><font color=#6F9915>99.67%</font></td>
                       </tr>
                       <tr>
                               <td><font color=#F92663>q16</font></td>
                               <td><font color=#F92663>12.95</font></td>
                               <td><font color=#F92663>13.65</font></td>
                               <td><font color=#F92663>0.703</font></td>
                               <td><font color=#F92663>105.43%</font></td>
                       </tr>
                       <tr>
                               <td><font color=#6F9915>q17</font></td>
                               <td><font color=#6F9915>104.35</font></td>
                               <td><font color=#6F9915>103.56</font></td>
                               <td><font color=#6F9915>-0.797</font></td>
                               <td><font color=#6F9915>99.24%</font></td>
                       </tr>
                       <tr>
                               <td><font color=#F92663>q18</font></td>
                               <td><font color=#F92663>144.05</font></td>
                               <td><font color=#F92663>145.21</font></td>
                               <td><font color=#F92663>1.157</font></td>
                               <td><font color=#F92663>100.80%</font></td>
                       </tr>
                       <tr>
                               <td><font color=#6F9915>q19</font></td>
                               <td><font color=#6F9915>14.83</font></td>
                               <td><font color=#6F9915>14.70</font></td>
                               <td><font color=#6F9915>-0.137</font></td>
                               <td><font color=#6F9915>99.08%</font></td>
                       </tr>
                       <tr>
                               <td><font color=#F92663>q20</font></td>
                               <td><font color=#F92663>26.64</font></td>
                               <td><font color=#F92663>28.92</font></td>
                               <td><font color=#F92663>2.279</font></td>
                               <td><font color=#F92663>108.56%</font></td>
                       </tr>
                       <tr>
                               <td><font color=#F92663>q21</font></td>
                               <td><font color=#F92663>257.09</font></td>
                               <td><font color=#F92663>262.04</font></td>
                               <td><font color=#F92663>4.950</font></td>
                               <td><font color=#F92663>101.93%</font></td>
                       </tr>
                       <tr>
                               <td><font color=#F92663>q22</font></td>
                               <td><font color=#F92663>13.05</font></td>
                               <td><font color=#F92663>14.56</font></td>
                               <td><font color=#F92663>1.506</font></td>
                               <td><font color=#F92663>111.54%</font></td>
                       </tr>
                       <tr>
                               <td><font color=#F92663>total</font></td>
                               <td><font color=#F92663>1256.13</font></td>
                               <td><font color=#F92663>1261.63</font></td>
                               <td><font color=#F92663>5.497</font></td>
                               <td><font color=#F92663>100.44%</font></td>
                       </tr>
                   </tbody>
               </table>


-- 
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: commits-unsubscribe@gluten.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org


Re: [PR] [CORE] Use SortShuffleManager instance in ColumnarShuffleManager [incubator-gluten]

Posted by "acvictor (via GitHub)" <gi...@apache.org>.
acvictor commented on code in PR #6022:
URL: https://github.com/apache/incubator-gluten/pull/6022#discussion_r1635842275


##########
backends-velox/src/test/scala/org/apache/gluten/execution/FallbackSuite.scala:
##########
@@ -71,6 +71,23 @@ class FallbackSuite extends VeloxWholeStageTransformerSuite with AdaptiveSparkPl
     collect(plan) { case v: VeloxColumnarToRowExec => v }.size
   }
 
+  test("fallback with shuffle manager") {
+    withSQLConf(GlutenConfig.COLUMNAR_SHUFFLE_ENABLED.key -> "false") {
+      runQueryAndCompare("select c1, count(*) from tmp1 group by c1") {
+        df =>
+          val plan = df.queryExecution.executedPlan
+          val columnarShuffle = find(plan) {
+            case _: ColumnarShuffledJoin => true

Review Comment:
   For the current query this is the plan
   ```
   AdaptiveSparkPlan isFinalPlan=true
   +- == Final Plan ==
      VeloxColumnarToRowExec
      +- ^(6) HashAggregateTransformer(keys=[c1#14], functions=[count(1)], output=[c1#14, count(1)#26L])
         +- ^(6) InputIteratorTransformer[c1#14, count#30L]
            +- ^(6) InputAdapter
               +- ^(6) RowToVeloxColumnar
                  +- ^(6) AQEShuffleRead coalesced
                     +- ^(6) ShuffleQueryStage 0
                        +- Exchange hashpartitioning(c1#14, 5), ENSURE_REQUIREMENTS, [plan_id=281]
                           +- VeloxColumnarToRowExec
                              +- ^(5) HashAggregateTransformer(keys=[c1#14], functions=[partial_count(1)], output=[c1#14, count#30L])
                                 +- ^(5) NativeFileScan parquet spark_catalog.default.tmp11111[c1#14] Batched: true, DataFilters: [], Format: Parquet, Location: InMemoryFileIndex(1 paths)[file:/home/anvicto/src/Gluten/spark-warehouse/org.apache.gluten.execut..., PartitionFilters: [], PushedFilters: [], ReadSchema: struct<c1:int>
   ```
   Can I retain it?



-- 
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: commits-unsubscribe@gluten.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org


Re: [PR] [CORE] Use SortShuffleManager instance in ColumnarShuffleManager [incubator-gluten]

Posted by "acvictor (via GitHub)" <gi...@apache.org>.
acvictor commented on code in PR #6022:
URL: https://github.com/apache/incubator-gluten/pull/6022#discussion_r1635848648


##########
backends-velox/src/test/scala/org/apache/gluten/execution/FallbackSuite.scala:
##########
@@ -71,6 +71,23 @@ class FallbackSuite extends VeloxWholeStageTransformerSuite with AdaptiveSparkPl
     collect(plan) { case v: VeloxColumnarToRowExec => v }.size
   }
 
+  test("fallback with shuffle manager") {
+    withSQLConf(GlutenConfig.COLUMNAR_SHUFFLE_ENABLED.key -> "false") {
+      runQueryAndCompare("select c1, count(*) from tmp1 group by c1") {
+        df =>
+          val plan = df.queryExecution.executedPlan
+          val columnarShuffle = find(plan) {
+            case _: ColumnarShuffledJoin => true

Review Comment:
   I have raised one small PR here https://github.com/apache/incubator-gluten/pull/6055 to enable fallback for shuffle.



-- 
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: commits-unsubscribe@gluten.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org