viirya commented on code in PR #58097: URL: https://github.com/apache/spark/pull/58097#discussion_r3816671413
########## sql/core/src/test/scala/org/apache/spark/sql/execution/exchange/PipelinedShuffleSqlSuite.scala: ########## @@ -0,0 +1,310 @@ +/* + * 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.spark.sql.execution.exchange + +import org.apache.spark.SparkFunSuite +import org.apache.spark.sql.SparkSession +import org.apache.spark.sql.execution.adaptive.AdaptiveSparkPlanHelper + +/** + * End-to-end SQL coverage of the pipelined channel path: a batch query whose hash + * exchange is rewritten to a pipelined shuffle (EnablePipelinedShuffle) and served by the + * in-process channel manager (PipelinedChannelShuffleManager), run through the + * concurrent-stage scheduler on a single executor. Self-manages its SparkSession because the + * shuffle manager and AQE-off gate are start-up configs. + */ +class PipelinedShuffleSqlSuite extends SparkFunSuite with AdaptiveSparkPlanHelper { + + private def withPipelinedSession(body: SparkSession => Unit): Unit = { + val spark = SparkSession.builder() + // High task-concurrency cap so the pipelined group's whole-group slot demand (the sum + // of every concurrent stage's partitions) is admitted. This is a correctness harness, + // not a perf one: on a smaller physical machine these logical slots oversubscribe the + // cores, which is fine for verifying results but meaningless for timing. + .master("local[16]") + .appName("pipelined-shuffle-sql") + .config("spark.shuffle.manager.incremental", + "org.apache.spark.shuffle.local.pipelined.PipelinedChannelShuffleManager") + .config("spark.sql.adaptive.enabled", "false") // rule only sees exchanges with AQE off + .config("spark.sql.pipelinedShuffle.enabled", "true") + .config("spark.speculation", "false") + .config("spark.sql.shuffle.partitions", "4") + .getOrCreate() Review Comment: Fixed in all three suites (`PipelinedShuffleSqlSuite`, `AQEPipelinedShuffleSuite`, `PipelinedLimitHangSuite`): each `with...Session` helper now stops any active/default session and clears both slots before the builder, so `getOrCreate()` cannot return a session another suite left in the JVM. -- 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]
