Skip to content

fix(gcp-spark): clarify S3A and Azure Storage batch config without _jsc - #576

Open
copybara-service[bot] wants to merge 1 commit into
mainfrom
test_1023764529
Open

copybara-service[bot] wants to merge 1 commit into
mainfrom
test_1023764529

Conversation

@copybara-service

Copy link
Copy Markdown
Contributor

fix(gcp-spark): clarify S3A and Azure Storage batch config without _jsc

On classic JVM SparkSession jobs, calling spark.conf.set("fs.s3a.*", ...) or
spark.conf.set("fs.azure.*", ...) after .getOrCreate() updates Spark SQL
configuration rather than the initialized SparkContext Hadoop Configuration.
Because references/aws_s3.md and references/azure_storage.md previously
framed the _jsc.hadoopConfiguration() ban around Spark Connect and showed only
spark.conf.set(...) for custom S3 endpoints and Azure Blob / OAuth examples,
standalone .py scripts fell back to _jsc or copied it from prior staging
buckets.

  • Bump gcp-spark to v36 in SKILL.md and scope the "author from scratch /
    do not copy prior staging scripts" rule to new scripts and notebooks so
    prompts modifying, upgrading, or debugging existing gs:// scripts are
    unaffected.
  • Update references/aws_s3.md and references/azure_storage.md to split
    standalone .py batch/cluster jobs (SparkSession.builder.config(...)
    before .getOrCreate()), Local Python / Spark Connect notebooks
    (spark.conf.set(...) or ManagedSparkSession.builder.config(...),
    dropping legacy session_config.runtime_config.properties), and
    pre-initialized Remote Kernel notebooks (spark.conf.set(...) for
    DataFrame/SQL reads/writes via SessionState.newHadoopConf()) without
    _jsc.hadoopConfiguration().
  • Keep spark.hadoop.fs.s3a.connection.ssl.enabled set to "true" by default
    in custom-endpoint examples with an inline comment noting "false" for
    plain HTTP endpoints, and add matching standalone .py vs. notebook
    examples for wasbs:// and ADLS Gen2 OAuth in
    references/azure_storage.md.
On classic JVM `SparkSession` jobs, calling `spark.conf.set("fs.s3a.*", ...)` or
`spark.conf.set("fs.azure.*", ...)` after `.getOrCreate()` updates Spark SQL
configuration rather than the initialized `SparkContext` Hadoop `Configuration`.
Because `references/aws_s3.md` and `references/azure_storage.md` previously
framed the `_jsc.hadoopConfiguration()` ban around Spark Connect and showed only
`spark.conf.set(...)` for custom S3 endpoints and Azure Blob / OAuth examples,
standalone `.py` scripts fell back to `_jsc` or copied it from prior staging
buckets.

-   Bump `gcp-spark` to `v36` in `SKILL.md` and scope the "author from scratch /
    do not copy prior staging scripts" rule to **new** scripts and notebooks so
    prompts modifying, upgrading, or debugging existing `gs://` scripts are
    unaffected.
-   Update `references/aws_s3.md` and `references/azure_storage.md` to split
    standalone `.py` batch/cluster jobs (`SparkSession.builder.config(...)`
    before `.getOrCreate()`), Local Python / Spark Connect notebooks
    (`spark.conf.set(...)` or `ManagedSparkSession.builder.config(...)`,
    dropping legacy `session_config.runtime_config.properties`), and
    pre-initialized Remote Kernel notebooks (`spark.conf.set(...)` for
    DataFrame/SQL reads/writes via `SessionState.newHadoopConf()`) without
    `_jsc.hadoopConfiguration()`.
-   Keep `spark.hadoop.fs.s3a.connection.ssl.enabled` set to `"true"` by default
    in custom-endpoint examples with an inline comment noting `"false"` for
    plain HTTP endpoints, and add matching standalone `.py` vs. notebook
    examples for `wasbs://` and ADLS Gen2 OAuth in
    `references/azure_storage.md`.

PiperOrigin-RevId: 1023764529
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant