Execute python code within a given Spark context/session.
Execute python code within a given Spark context/session. This executes python as a subprocess and then has it connect back to the py4j-Gateway.
py4j gateway entrypoint java object available in python code as gateway.entry_point. This is used to transfer SparkContext to python and can hold additional custom parameters. entryPointObj must at least implement trait SparkEntryPoint.
python code as string.
Functions to execute Python-Spark code
Copyright note: code is mostly copied from org.apache.spark.deploy.PythonRunner Changes: parameter for customized entrypoint to reuse existing spark session