Skip to content

Commit 7f749a9

Browse files
authored
Fix hadoop version tests. (#34155)
* Fix hadoop version tests. * Trigger post-commit tests.
1 parent 468aa4e commit 7f749a9

File tree

6 files changed

+25
-6
lines changed

6 files changed

+25
-6
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
22
"comment": "Modify this file in a trivial way to cause this test suite to run",
3-
"modification": 3
3+
"modification": 4
44
}

.github/trigger_files/beam_PostCommit_Java_ValidatesRunner_Spark.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,6 @@
66
"https://github.com/apache/beam/pull/33267": "noting that PR #33267 should run this test",
77
"https://github.com/apache/beam/pull/33322": "noting that PR #33322 should run this test",
88
"https://github.com/apache/beam/pull/34123": "noting that PR #34123 should run this test",
9-
"https://github.com/apache/beam/pull/34080": "noting that PR #34080 should run this test"
9+
"https://github.com/apache/beam/pull/34080": "noting that PR #34080 should run this test",
10+
"https://github.com/apache/beam/pull/34155": "noting that PR #34155 should run this test"
1011
}

.github/trigger_files/beam_PostCommit_Java_ValidatesRunner_SparkStructuredStreaming.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,6 @@
55
"https://github.com/apache/beam/pull/32546": "noting that PR #32546 should run this test",
66
"https://github.com/apache/beam/pull/33267": "noting that PR #33267 should run this test",
77
"https://github.com/apache/beam/pull/34123": "noting that PR #34123 should run this test",
8-
"https://github.com/apache/beam/pull/34080": "noting that PR #34080 should run this test"
8+
"https://github.com/apache/beam/pull/34080": "noting that PR #34080 should run this test",
9+
"https://github.com/apache/beam/pull/34155": "noting that PR #34155 should run this test"
910
}

.github/trigger_files/beam_PostCommit_Java_ValidatesRunner_Spark_Java11.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,6 @@
55
"https://github.com/apache/beam/pull/32546": "noting that PR #32546 should run this test",
66
"https://github.com/apache/beam/pull/33267": "noting that PR #33267 should run this test",
77
"https://github.com/apache/beam/pull/33322": "noting that PR #33322 should run this test",
8-
"https://github.com/apache/beam/pull/34080": "noting that PR #34080 should run this test"
8+
"https://github.com/apache/beam/pull/34080": "noting that PR #34080 should run this test",
9+
"https://github.com/apache/beam/pull/34155": "noting that PR #34155 should run this test"
910
}

buildSrc/src/main/groovy/org/apache/beam/gradle/BeamModulePlugin.groovy

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -836,6 +836,8 @@ class BeamModulePlugin implements Plugin<Project> {
836836
log4j2_core : "org.apache.logging.log4j:log4j-core:$log4j2_version",
837837
log4j2_to_slf4j : "org.apache.logging.log4j:log4j-to-slf4j:$log4j2_version",
838838
log4j2_slf4j_impl : "org.apache.logging.log4j:log4j-slf4j-impl:$log4j2_version",
839+
log4j2_slf4j2_impl : "org.apache.logging.log4j:log4j-slf4j2-impl:$log4j2_version",
840+
log4j2_log4j12_api : "org.apache.logging.log4j:log4j-1.2-api:$log4j2_version",
839841
mockito_core : "org.mockito:mockito-core:4.11.0",
840842
mockito_inline : "org.mockito:mockito-inline:4.11.0",
841843
mongo_java_driver : "org.mongodb:mongo-java-driver:3.12.11",

runners/spark/spark_runner.gradle

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,12 +216,17 @@ dependencies {
216216
validatesRunner project(":sdks:java:io:hadoop-format").sourceSets.test.output
217217
validatesRunner project(path: ":examples:java", configuration: "testRuntimeMigration")
218218
validatesRunner project(path: project.path, configuration: "testRuntimeMigration")
219-
validatesRunner library.java.log4j2_api
220-
validatesRunner library.java.log4j2_core
221219
hadoopVersions.each { kv ->
222220
"hadoopVersion$kv.key" "org.apache.hadoop:hadoop-common:$kv.value"
223221
// Force paranamer 2.8 to avoid issues when using Scala 2.12
224222
"hadoopVersion$kv.key" "com.thoughtworks.paranamer:paranamer:2.8"
223+
if ("$spark_version" >= "3.5.0") {
224+
// Add log4j 2.x dependencies as Spark 3.5+ uses slf4j with log4j 2.x backend
225+
"hadoopVersion$kv.key" library.java.log4j2_api
226+
"hadoopVersion$kv.key" library.java.log4j2_core
227+
"hadoopVersion$kv.key" library.java.log4j2_slf4j2_impl
228+
"hadoopVersion$kv.key" library.java.log4j2_log4j12_api
229+
}
225230
}
226231
}
227232

@@ -240,13 +245,22 @@ configurations.all {
240245
configurations.validatesRunner {
241246
// Exclude to make sure log4j binding is used
242247
exclude group: "org.slf4j", module: "slf4j-simple"
248+
249+
if ("$spark_version" >= "3.5.0") {
250+
// Exclude log4j 1.x dependencies to prevent conflict with log4j 2.x used by spark 3.5+
251+
exclude group: "log4j", module: "log4j"
252+
}
243253
}
244254

245255
hadoopVersions.each { kv ->
246256
configurations."hadoopVersion$kv.key" {
247257
resolutionStrategy {
248258
force "org.apache.hadoop:hadoop-common:$kv.value"
249259
}
260+
if ("$spark_version" >= "3.5.0") {
261+
// Exclude log4j 1.x dependencies to prevent conflict with log4j 2.x used by spark 3.5+
262+
exclude group: "log4j", module: "log4j"
263+
}
250264
}
251265
}
252266

0 commit comments

Comments
 (0)