jk-shah opened a new issue, #41080:
URL: https://github.com/apache/beam/issues/41080

   ### What happened?
   
   
   Submitting a Python (or Beam YAML) pipeline to a Spark standalone REST 
cluster via `--runner=SparkRunner --spark_submit_uber_jar 
--spark_rest_url=http://<master>:6066` fails on the Spark driver unless the 
user manually passes `--storage_level=MEMORY_ONLY`.
   
   ### Cause
   
   In 
`runners/spark/src/main/java/org/apache/beam/runners/spark/SparkCommonPipelineOptions.java`
 (lines 102–109):
   
   ```java
     class StorageLevelFactory implements DefaultValueFactory<String> {
       @Override
       public String create(PipelineOptions options) {
         return SparkStructuredStreamingRunner.class.equals(options.getRunner())
             ? "MEMORY_AND_DISK"
             : "MEMORY_ONLY";
       }
     }
   
   ```
   
   When the portable pipeline options JSON is serialized by the Python SDK 
(--runner=SparkRunner), options.getRunner() on the Java side attempts to 
resolve the Python runner string via Java PipelineOptions.RunnerFactory (or 
sees an unset/non-Java runner name) and throws IllegalArgumentException when 
getStorageLevel() triggers StorageLevelFactory.create(options). Explicitly 
passing --storage_level=MEMORY_ONLY bypasses StorageLevelFactory and succeeds.
   
   Catching IllegalArgumentException (or inspecting options safely when 
getRunner() is a portable Python runner string) and defaulting to "MEMORY_ONLY" 
fixes --spark_submit_uber_jar out of the box.
   
   
   ### Issue Priority
   
   Priority: 2 (default / most bugs should be filed as P2)
   
   ### Issue Components
   
   - [x] Component: Python SDK
   - [ ] Component: Java SDK
   - [ ] Component: Go SDK
   - [ ] Component: Typescript SDK
   - [ ] Component: IO connector
   - [ ] Component: Beam YAML
   - [ ] Component: Beam examples
   - [ ] Component: Beam playground
   - [ ] Component: Beam katas
   - [ ] Component: Website
   - [ ] Component: Infrastructure
   - [x] Component: Spark Runner
   - [ ] Component: Flink Runner
   - [ ] Component: Prism Runner
   - [ ] Component: Hazelcast Jet Runner
   - [ ] Component: Google Cloud Dataflow Runner


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