You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hudi.apache.org by "voonhous (via GitHub)" <gi...@apache.org> on 2026/09/12 17:36:01 UTC
[PR] test(spark): shared SparkContext for the SQL suites, opt-in [hudi]
voonhous opened a new pull request, #19926:
URL: https://github.com/apache/hudi/pull/19926
### Describe the issue this Pull Request addresses
Part of #19524, stacked on #19919 (the CI stack's commits are included until it merges). Supersedes the proof of concept #19921, which branched from master. The Java CI wall clock is set by the Scala SQL shards; scalatest has no fork count, so the lever is running suites concurrently in one JVM, which needs one shared SparkContext. This PR makes that shared lifecycle exist behind a property and runs it serially; #19923's successor removes the cross-suite state and the third PR turns the concurrency on.
### Summary and Changelog
- New pom property `hudi.spark.test.sharedSession` (default `false`), forwarded to the scalatest JVM. With it on, every suite on `HoodieSparkSqlTestBase` shares one never-stopped SparkContext and works in its own `SparkSession.newSession()` child: own SQL conf, temp views and HoodieCatalog; shared external catalog and warehouse.
- A suite's conf deltas (`extraConf`, `sparkConf()` overrides) are validated first, then applied to the child session; `spark.hadoop.*` keys go to the shared Hadoop conf and are restored in `afterAll`; any other context-level or static key is rejected before anything mutates.
- The child session is pinned as the active session on the suite thread, with a fail-fast check that the session's HoodieCatalog is bound to it. The per-test cleanup drops only the suite's own tables.
- Switched on for the three Java 17 Scala shards whose packages hold only `HoodieSparkSqlTestBase` suites: dml-1, dml-2, other-1. other-2 mixes in suites that create their own SparkContext and stays on the default.
- `TestHoodieDataUtils` no longer closes its JavaSparkContext in `afterAll` (it stopped the context).
With the property off, nothing changes.
<details>
<summary>Evidence from the proof of concept (#19921)</summary>
On master's layout the dml job ran in shared mode, serially, at master's own time: 51:56 and 53:08 ([run 34676800123](https://github.com/apache/hudi/actions/runs/34676800123), attempts 1 and 2) against 52 to 56 minutes for the same job on seven recent master runs (41:22 on one fast runner), with the same 326 tests, 4 canceled and 1 ignored. Two review rounds on #19921 are folded in: the conf deltas are validated before any mutation, static SQL confs are rejected, and generateTableName builds on the prefix the cleanup relies on.
</details>
### Impact
Test infrastructure only. No production code changes.
### Risk Level
low. Default behaviour is unchanged; the shared mode runs on three CI shards and was verified on #19921.
### Documentation Update
none
### Contributor's checklist
- [x] Read through [contributor's guide](https://hudi.apache.org/contribute/how-to-contribute)
- [x] Enough context is provided in the sections above
- [x] Adequate tests were added if applicable
--
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@hudi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] test(spark): shared SparkContext for the SQL suites, opt-in [hudi]
Posted by "voonhous (via GitHub) via commits" <co...@hudi.apache.org>.
voonhous closed pull request #19926: test(spark): shared SparkContext for the SQL suites, opt-in
URL: https://github.com/apache/hudi/pull/19926
--
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@hudi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] test(spark): shared SparkContext for the SQL suites, opt-in [hudi]
Posted by "hudi-bot (via GitHub)" <gi...@apache.org>.
hudi-bot commented on PR #19926:
URL: https://github.com/apache/hudi/pull/19926#issuecomment-5648832365
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "24b3190910cd115327dd92fee20b1b45a941992e",
"status" : "SUCCESS",
"url" : "https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=17054",
"triggerID" : "24b3190910cd115327dd92fee20b1b45a941992e",
"triggerType" : "PUSH"
}, {
"hash" : "21d5047067cf047f635202dee55ee259a4912f9e",
"status" : "PENDING",
"url" : "https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=17058",
"triggerID" : "21d5047067cf047f635202dee55ee259a4912f9e",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 24b3190910cd115327dd92fee20b1b45a941992e Azure: [SUCCESS](https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=17054)
* 21d5047067cf047f635202dee55ee259a4912f9e Azure: [PENDING](https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=17058)
<details>
<summary>Bot commands</summary>
@hudi-bot supports the following commands:
- `@hudi-bot run azure` re-run the last Azure build
</details>
--
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@hudi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] test(spark): shared SparkContext for the SQL suites, opt-in [hudi]
Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #19926:
URL: https://github.com/apache/hudi/pull/19926#issuecomment-5647619201
## [Codecov](https://app.codecov.io/gh/apache/hudi/pull/19926?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
:white_check_mark: All modified and coverable lines are covered by tests.
:white_check_mark: Project coverage is 76.56%. Comparing base ([`648996f`](https://app.codecov.io/gh/apache/hudi/commit/648996f002c3c9e24a1e2bf53f97fe03e8bc4c81?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`24b3190`](https://app.codecov.io/gh/apache/hudi/commit/24b3190910cd115327dd92fee20b1b45a941992e?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
:warning: Report is 7 commits behind head on master.
<details><summary>Additional details and impacted files</summary>
```diff
@@ Coverage Diff @@
## master #19926 +/- ##
============================================
- Coverage 80.20% 76.56% -3.65%
+ Complexity 34661 33482 -1179
============================================
Files 2546 2546
Lines 142452 143992 +1540
Branches 17330 17630 +300
============================================
- Hits 114260 110248 -4012
- Misses 20281 25545 +5264
- Partials 7911 8199 +288
```
| [Components](https://app.codecov.io/gh/apache/hudi/pull/19926/components?src=pr&el=components&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
|---|---|---|
| [hudi-common](https://app.codecov.io/gh/apache/hudi/pull/19926/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `81.81% <ø> (-2.04%)` | :arrow_down: |
| [hudi-client](https://app.codecov.io/gh/apache/hudi/pull/19926/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `77.08% <ø> (-6.20%)` | :arrow_down: |
| [hudi-flink](https://app.codecov.io/gh/apache/hudi/pull/19926/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `84.63% <ø> (-0.95%)` | :arrow_down: |
| [hudi-spark-datasource](https://app.codecov.io/gh/apache/hudi/pull/19926/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `65.72% <ø> (-7.56%)` | :arrow_down: |
| [hudi-utilities](https://app.codecov.io/gh/apache/hudi/pull/19926/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `75.11% <ø> (-3.06%)` | :arrow_down: |
| [hudi-cli](https://app.codecov.io/gh/apache/hudi/pull/19926/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `69.99% <ø> (ø)` | |
| [hudi-hadoop](https://app.codecov.io/gh/apache/hudi/pull/19926/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `68.02% <ø> (-2.79%)` | :arrow_down: |
| [hudi-sync](https://app.codecov.io/gh/apache/hudi/pull/19926/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `75.99% <ø> (ø)` | |
| [hudi-io](https://app.codecov.io/gh/apache/hudi/pull/19926/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `81.24% <ø> (-0.38%)` | :arrow_down: |
| [hudi-timeline-service](https://app.codecov.io/gh/apache/hudi/pull/19926/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `78.42% <ø> (-4.93%)` | :arrow_down: |
| [hudi-cloud](https://app.codecov.io/gh/apache/hudi/pull/19926/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `80.99% <ø> (ø)` | |
| [hudi-kafka-connect](https://app.codecov.io/gh/apache/hudi/pull/19926/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `53.20% <ø> (ø)` | |
| [Flag](https://app.codecov.io/gh/apache/hudi/pull/19926/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
|---|---|---|
| [hadoop-mr-java-client](https://app.codecov.io/gh/apache/hudi/pull/19926/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `43.83% <ø> (-0.10%)` | :arrow_down: |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#carryforward-flags-in-the-pull-request-comment) to find out more.
[see 506 files with indirect coverage changes](https://app.codecov.io/gh/apache/hudi/pull/19926/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
</details>
<details><summary> :rocket: New features to boost your workflow: </summary>
- :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
- :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
</details>
--
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@hudi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] test(spark): shared SparkContext for the SQL suites, opt-in [hudi]
Posted by "hudi-bot (via GitHub)" <gi...@apache.org>.
hudi-bot commented on PR #19926:
URL: https://github.com/apache/hudi/pull/19926#issuecomment-5647966859
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "24b3190910cd115327dd92fee20b1b45a941992e",
"status" : "PENDING",
"url" : "https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=17054",
"triggerID" : "24b3190910cd115327dd92fee20b1b45a941992e",
"triggerType" : "PUSH"
}, {
"hash" : "21d5047067cf047f635202dee55ee259a4912f9e",
"status" : "PENDING",
"url" : "https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=17058",
"triggerID" : "21d5047067cf047f635202dee55ee259a4912f9e",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 24b3190910cd115327dd92fee20b1b45a941992e Azure: [PENDING](https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=17054)
* 21d5047067cf047f635202dee55ee259a4912f9e Azure: [PENDING](https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=17058)
<details>
<summary>Bot commands</summary>
@hudi-bot supports the following commands:
- `@hudi-bot run azure` re-run the last Azure build
</details>
--
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@hudi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] test(spark): shared SparkContext for the SQL suites, opt-in [hudi]
Posted by "hudi-bot (via GitHub)" <gi...@apache.org>.
hudi-bot commented on PR #19926:
URL: https://github.com/apache/hudi/pull/19926#issuecomment-5649054106
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "24b3190910cd115327dd92fee20b1b45a941992e",
"status" : "DELETED",
"url" : "https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=17054",
"triggerID" : "24b3190910cd115327dd92fee20b1b45a941992e",
"triggerType" : "PUSH"
}, {
"hash" : "21d5047067cf047f635202dee55ee259a4912f9e",
"status" : "SUCCESS",
"url" : "https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=17058",
"triggerID" : "21d5047067cf047f635202dee55ee259a4912f9e",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 21d5047067cf047f635202dee55ee259a4912f9e Azure: [SUCCESS](https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=17058)
<details>
<summary>Bot commands</summary>
@hudi-bot supports the following commands:
- `@hudi-bot run azure` re-run the last Azure build
</details>
--
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@hudi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] test(spark): shared SparkContext for the SQL suites, opt-in [hudi]
Posted by "hudi-bot (via GitHub)" <gi...@apache.org>.
hudi-bot commented on PR #19926:
URL: https://github.com/apache/hudi/pull/19926#issuecomment-5647934627
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "24b3190910cd115327dd92fee20b1b45a941992e",
"status" : "PENDING",
"url" : "https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=17054",
"triggerID" : "24b3190910cd115327dd92fee20b1b45a941992e",
"triggerType" : "PUSH"
}, {
"hash" : "21d5047067cf047f635202dee55ee259a4912f9e",
"status" : "UNKNOWN",
"url" : "TBD",
"triggerID" : "21d5047067cf047f635202dee55ee259a4912f9e",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 24b3190910cd115327dd92fee20b1b45a941992e Azure: [PENDING](https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=17054)
* 21d5047067cf047f635202dee55ee259a4912f9e UNKNOWN
<details>
<summary>Bot commands</summary>
@hudi-bot supports the following commands:
- `@hudi-bot run azure` re-run the last Azure build
</details>
--
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@hudi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] test(spark): shared SparkContext for the SQL suites, opt-in [hudi]
Posted by "hudi-bot (via GitHub)" <gi...@apache.org>.
hudi-bot commented on PR #19926:
URL: https://github.com/apache/hudi/pull/19926#issuecomment-5647615036
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "24b3190910cd115327dd92fee20b1b45a941992e",
"status" : "PENDING",
"url" : "https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=17054",
"triggerID" : "24b3190910cd115327dd92fee20b1b45a941992e",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 24b3190910cd115327dd92fee20b1b45a941992e Azure: [PENDING](https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=17054)
<details>
<summary>Bot commands</summary>
@hudi-bot supports the following commands:
- `@hudi-bot run azure` re-run the last Azure build
</details>
--
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@hudi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] test(spark): shared SparkContext for the SQL suites, opt-in [hudi]
Posted by "hudi-bot (via GitHub)" <gi...@apache.org>.
hudi-bot commented on PR #19926:
URL: https://github.com/apache/hudi/pull/19926#issuecomment-5647583259
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "24b3190910cd115327dd92fee20b1b45a941992e",
"status" : "UNKNOWN",
"url" : "TBD",
"triggerID" : "24b3190910cd115327dd92fee20b1b45a941992e",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 24b3190910cd115327dd92fee20b1b45a941992e UNKNOWN
<details>
<summary>Bot commands</summary>
@hudi-bot supports the following commands:
- `@hudi-bot run azure` re-run the last Azure build
</details>
--
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@hudi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] test(spark): shared SparkContext for the SQL suites, opt-in [hudi]
Posted by "voonhous (via GitHub) via commits" <co...@hudi.apache.org>.
voonhous commented on PR #19926:
URL: https://github.com/apache/hudi/pull/19926#issuecomment-6701431371
Temporarily closing this PR while we debug a GitHub settings error on master (#20471); it will be reopened shortly, no action needed.
--
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@hudi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org