Spark job specification reference

The job specification defines how your Spark job runs. In SQL it’s the YAML in the WITH SPECIFICATION clause; in the REST API it’s the bundle object in the request body. The following fields apply to Spark jobs. For the full set of generic configuration fields, see the code_bundle.yml reference.

FieldRequired?LanguageDescription
typeRequiredAllMust be spark for Spark jobs.
compute_typeRequiredAllMust be warehouse. The job runs on the session’s warehouse.
languageRequiredAllscala, java, or python.
compute_options.runtime_versionOptionalAllThe Snowpark Connect for Spark client version (snowpark-connect) to run with, installed at job startup (for example, "1.41.0"). Defaults to the latest available client version. Also determines the snowflake-snowpark-python version and the supported Python range.
compute_options.language_versionRequired for Scala/Java; Optional for PythonAllFor Python, the Python interpreter version (for example, "3.12"); defaults to "3.11" and is constrained by the selected client version. Required for Scala/Java: the Scala binary version ("2.12" or "2.13"), which must match your JAR’s compiled Scala version.
properties.spark_confOptionalAllMap of Spark configuration properties.
properties.java_dependencies.jarsOptionalScala/JavaList of dependency JARs on a stage. Added to the classpath automatically.
properties.python_filesOptionalPythonList of Python files or archives placed on PYTHONPATH. Not installed (unlike python_dependencies).
properties.python_dependencies.wheelsOptionalPythonList of Python wheels (.whl) on a stage. On warehouse compute the wheels are staged with the job but are not automatically installed; to install packages, use packages or requirements_files.
properties.python_dependencies.requirements_filesOptionalPythonList of stage paths to requirements.txt files.
properties.python_dependencies.packagesOptionalPythonList of PyPI packages to install (for example, numpy==1.26.4).
artifact_repositoriesOptionalPythonList of artifact repositories used to resolve PyPI dependencies (on warehouse compute, at most one). Defaults to snowflake.snowpark.pypi_shared_repository.
secretsOptionalAllList of Snowflake secrets to attach.
external_access_integrationsOptionalAllList of external access integrations to attach.

compute_options.runtime_version

The runtime_version property selects the Snowpark Connect for Spark client version (the snowpark-connect package) that the job runs with; the value is installed as snowpark-connect==<runtime_version> at job startup. It’s optional: when omitted, Snowflake uses the latest available client version. The selected client version also determines the snowflake-snowpark-python version and the range of Python interpreter versions you can select with language_version. Always quote the value.

compute_options.language_version

The language_version property selects the language runtime:

  • For Python, it’s the Python interpreter version (for example, "3.12"). When omitted, it defaults to "3.11". The versions you can select are constrained by the client version chosen with runtime_version.
  • For Scala or Java, it’s the Scala binary version ("2.12" or "2.13") and is required. It must match the Scala version your JAR was compiled with; a mismatch prevents the Spark session from starting.

Always quote the value.

properties.python_files

The python_files list specifies Python files or archives to place on PYTHONPATH. They are made importable but are not installed (unlike python_dependencies). Use it for your own modules and supporting code.

properties.python_dependencies

The python_dependencies object specifies the Python dependencies for the job:

  • packages: PyPI package specifiers to install (for example, numpy==1.26.4).
  • requirements_files: stage paths to requirements.txt files whose packages are installed.
  • wheels: wheel files (.whl) on a stage.

PyPI dependencies in packages and requirements_files are resolved and installed through an artifact repository. If you don’t set artifact_repositories, Snowflake uses the account-level snowflake.snowpark.pypi_shared_repository, which proxies PyPI and doesn’t require an external access integration. To use the Snowflake Anaconda channel, set artifact_repositories to snowflake.snowpark.anaconda_shared_repository.

Note

On warehouse compute, wheels listed in wheels are staged with the job but are not automatically installed. To install a package, add it to packages or to a requirements.txt referenced by requirements_files.

properties.java_dependencies.jars

(Scala/Java) The jars list specifies dependency JARs on a stage to add to the job’s classpath automatically. Use it for libraries your application needs in addition to your main JAR.

properties.spark_conf

The spark_conf property is a map of Spark configuration properties applied to the job’s Spark session.