Tarun4201 opened a new pull request, #41083:
URL: https://github.com/apache/beam/pull/41083

   ## Description
   In portable Beam pipelines and Beam YAML running inside the Java SDK harness 
container (`FnHarness`), `StringCompiler` failed to resolve 
`org.apache.beam.sdk.values.Row` when dynamically compiling schema 
transforms/UDFs (such as `JavaFilterTransformProvider` and `JavaRowUdf`). 
   
   This failure occurs because `FnHarness` launches with a `pathing.jar` 
containing manifest `Class-Path` entries. On modern JDKs (JDK 11+), 
`AppClassLoader` does not extend `URLClassLoader`, which previously caused 
manifest parsing to be skipped. Furthermore, manifest paths were not resolved 
from `java.class.path` or unescaped from `file:` URI schemes.
   
   ## Changes Made
   - Expanded `StringCompiler.buildClasspath` to inspect `Class-Path` manifest 
attributes of JAR files present on `java.class.path`.
   - Added support for space-separated tokens, `file:` URI schemes, and 
relative paths within manifests.
   - Added direct resolution of `Row.class` and `StringCompiler.class` 
locations via `ProtectionDomain.getCodeSource()` and 
`ClassLoader.getResource()`.
   - Added unit and regression tests in `StringCompilerTest` to verify manifest 
resolution and successful `Row` compilation.
   
   ## Testing
   - `./gradlew :sdks:java:core:test --tests 
"org.apache.beam.sdk.schemas.transforms.providers.StringCompilerTest"` (6/6 
passed)
   - `./gradlew :sdks:java:core:test --tests 
"org.apache.beam.sdk.schemas.transforms.providers.*"` (12/12 passed)
   - `./gradlew :sdks:java:core:spotlessCheck` (BUILD SUCCESSFUL)
   
   ## Related Issue
   Closes #41079
   


-- 
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]

Reply via email to