Skip to content

Commit fc122e8

Browse files
authored
build: Set thread thresholds envs for spark test on macOS (#2987)
1 parent 0ae6515 commit fc122e8

File tree

2 files changed

+16
-8
lines changed

2 files changed

+16
-8
lines changed

.github/workflows/pr_build_macos.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -132,14 +132,6 @@ jobs:
132132
value: |
133133
org.apache.spark.sql.CometToPrettyStringSuite
134134
135-
exclude:
136-
# Skip fuzz suite for Spark 4.0
137-
# https://github.com/apache/datafusion-comet/issues/2965
138-
- profile:
139-
name: "Spark 4.0, JDK 17, Scala 2.13"
140-
suite:
141-
name: "fuzz"
142-
143135
fail-fast: false
144136
name: ${{ matrix.os }}/${{ matrix.profile.name }} [${{ matrix.suite.name }}]
145137
runs-on: ${{ matrix.os }}
@@ -152,6 +144,14 @@ jobs:
152144
jdk-version: ${{ matrix.profile.java_version }}
153145
jdk-architecture: aarch64
154146
protoc-architecture: aarch_64
147+
- name: Set thread thresholds envs for spark test on macOS
148+
# see: https://github.com/apache/datafusion-comet/issues/2965
149+
shell: bash
150+
run: |
151+
echo "SPARK_TEST_SQL_SHUFFLE_EXCHANGE_MAX_THREAD_THRESHOLD=256" >> $GITHUB_ENV
152+
echo "SPARK_TEST_SQL_RESULT_QUERY_STAGE_MAX_THREAD_THRESHOLD=256" >> $GITHUB_ENV
153+
echo "SPARK_TEST_HIVE_SHUFFLE_EXCHANGE_MAX_THREAD_THRESHOLD=48" >> $GITHUB_ENV
154+
echo "SPARK_TEST_HIVE_RESULT_QUERY_STAGE_MAX_THREAD_THRESHOLD=48" >> $GITHUB_ENV
155155
- name: Java test steps
156156
uses: ./.github/actions/java-test
157157
with:

spark/src/test/scala/org/apache/spark/sql/CometTestBase.scala

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,14 @@ abstract class CometTestBase
8989
// this is an edge case, and we expect most users to allow sorts on floating point, so we
9090
// enable this for the tests
9191
conf.set(CometConf.getExprAllowIncompatConfigKey("SortOrder"), "true")
92+
// For spark 4.0 tests, we need limit the thread threshold to avoid OOM, see:
93+
// https://github.com/apache/datafusion-comet/issues/2965
94+
conf.set(
95+
"spark.sql.shuffleExchange.maxThreadThreshold",
96+
sys.env.getOrElse("SPARK_TEST_SQL_SHUFFLE_EXCHANGE_MAX_THREAD_THRESHOLD", "1024"))
97+
conf.set(
98+
"spark.sql.resultQueryStage.maxThreadThreshold",
99+
sys.env.getOrElse("SPARK_TEST_SQL_RESULT_QUERY_STAGE_MAX_THREAD_THRESHOLD", "1024"))
92100
conf
93101
}
94102

0 commit comments

Comments
 (0)