Databricks Certified Associate Developer for Apache Spark — Question 190
A developer wants to test Spark Connect with an existing Spark application.
What are the two alternative ways the developer can start a local Spark Connect server without changing their existing application code? (Choose two.)
Answer options
- A. Execute their pyspark shell with the option --remote "https: //localhost"
- B. Execute their pyspark shell with the option --remote "sc: //localhost”
- C. Set the environment variable SPARK_REMOTE="sc://localhost” before starting the pyspark shell
- D. Add .remote ("sc://localhost") to their SparkSession.builder calls in their Spark code
- E. Ensure the spark property spark.connect.grpc.binding.port is set to 15002 in the application code
Correct answer: A, D
Explanation
The correct answers are A and D. Option A allows the developer to start the pyspark shell with a remote connection without altering the application code, while option D modifies the SparkSession.builder to include the remote connection, which does not require changing the core application logic. Options B, C, and E involve either incorrect syntax or require changes to the code or environment that the developer is trying to avoid.