Skip to content

[SPARK-58940][SDP][DOC] Add migration notes for Declarative Pipelines case sensitivity - #58222

Closed
szehon-ho wants to merge 2 commits into
apache:masterfrom
szehon-ho:docs-sdp-case-sensitivity-migration-note
Closed

[SPARK-58940][SDP][DOC] Add migration notes for Declarative Pipelines case sensitivity#58222
szehon-ho wants to merge 2 commits into
apache:masterfrom
szehon-ho:docs-sdp-case-sensitivity-migration-note

Conversation

@szehon-ho

Copy link
Copy Markdown
Member

What changes were proposed in this pull request?

Adds two entries to the "Upgrading from Spark SQL 4.2 to 4.3" section of
docs/sql-migration-guide.md, documenting the behavior change made by
SPARK-58517 (#57722):

  • Declarative Pipelines now honors spark.sql.caseSensitive when inferring and
    evolving pipeline table schemas. Under case-insensitive resolution (the
    default), column names differing only in case identify the same column, so
    flows contribute a single column rather than one per spelling, and the note
    states which spelling survives.
  • All flows writing to one pipeline table must agree on the effective
    spark.sql.caseSensitive, or the update fails with the new
    CONFLICTING_PIPELINE_FLOW_CASE_SENSITIVITY error condition.

Documentation only; no code change.

Why are the changes needed?

SPARK-58517 first ships in 4.3.0 (merged to master, branch-4.x, and
branch-4.3), and the behavior it changed has been in place since 4.1.0:
SchemaMergingUtils.mergeSchemas merged positionally, leaving
StructType.merge's caseSensitive = true default; DataflowGraph.inferredSchema
merged with reduce(SchemaMergingUtils.mergeSchemas); and
SchemaInferenceUtils.diffSchemas keyed columns on exact field names. Users
upgrading from 4.1.x or 4.2.x will see two observable differences that a
migration note should cover:

  • A target schema that previously evolved to carry both spellings, then failed
    later with errors such as COLUMN_ALREADY_EXISTS or AMBIGUOUS_REFERENCE,
    now folds into a single column.
  • A pipeline whose flows disagree on spark.sql.caseSensitive now fails up
    front with CONFLICTING_PIPELINE_FLOW_CASE_SENSITIVITY.

Does this PR introduce any user-facing change?

No. This is a documentation-only change. It documents a user-facing change that
was already made by SPARK-58517.

How was this patch tested?

No tests; documentation only. The error condition names in the notes were
checked against the tree (CONFLICTING_PIPELINE_FLOW_CASE_SENSITIVITY in
error-conditions.json, UNABLE_TO_INFER_PIPELINE_TABLE_SCHEMA in
GraphErrors.scala), as was the "lowest flow identifier wins" rule
(SchemaInferenceUtils.inferSchemaFromFlows sorts by
_.identifier.unquotedString). The link form
declarative-pipelines-programming-guide.html matches the existing link in
docs/index.md.

Was this patch authored or co-authored using generative AI tooling?

Generated-by: Claude Opus 5 (Cursor)

… case sensitivity

SPARK-58517 made Declarative Pipelines honor spark.sql.caseSensitive when
inferring and evolving pipeline table schemas, but described the change as
affecting only unreleased branches, so no migration note was added. The
previous case-sensitive-only behavior did ship in 4.1.x and 4.2.x, and the
change also introduces a new error condition when flows disagree on the
effective value.

@anew anew left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me. Thanks @szehon-ho !

@uros-b

uros-b commented Aug 22, 2026

Copy link
Copy Markdown
Member

+1, thank you @szehon-ho and @anew!

Comment thread docs/sql-migration-guide.md Outdated
…P migration notes

Surviving column spelling depends on declared schema, incremental streaming tables, and materialized views, not only on persisted columns.
@szehon-ho szehon-ho closed this in 5a26f48 Aug 24, 2026
szehon-ho added a commit that referenced this pull request Aug 24, 2026
… case sensitivity

### What changes were proposed in this pull request?

Adds two entries to the "Upgrading from Spark SQL 4.2 to 4.3" section of
`docs/sql-migration-guide.md`, documenting the behavior change made by
SPARK-58517 (#57722):

- Declarative Pipelines now honors `spark.sql.caseSensitive` when inferring and
  evolving pipeline table schemas. Under case-insensitive resolution (the
  default), column names differing only in case identify the same column, so
  flows contribute a single column rather than one per spelling, and the note
  states which spelling survives.
- All flows writing to one pipeline table must agree on the effective
  `spark.sql.caseSensitive`, or the update fails with the new
  `CONFLICTING_PIPELINE_FLOW_CASE_SENSITIVITY` error condition.

Documentation only; no code change.

### Why are the changes needed?

SPARK-58517 first ships in 4.3.0 (merged to `master`, `branch-4.x`, and
`branch-4.3`), and the behavior it changed has been in place since 4.1.0:
`SchemaMergingUtils.mergeSchemas` merged positionally, leaving
`StructType.merge`'s `caseSensitive = true` default; `DataflowGraph.inferredSchema`
merged with `reduce(SchemaMergingUtils.mergeSchemas)`; and
`SchemaInferenceUtils.diffSchemas` keyed columns on exact field names. Users
upgrading from 4.1.x or 4.2.x will see two observable differences that a
migration note should cover:

- A target schema that previously evolved to carry both spellings, then failed
  later with errors such as `COLUMN_ALREADY_EXISTS` or `AMBIGUOUS_REFERENCE`,
  now folds into a single column.
- A pipeline whose flows disagree on `spark.sql.caseSensitive` now fails up
  front with `CONFLICTING_PIPELINE_FLOW_CASE_SENSITIVITY`.

### Does this PR introduce _any_ user-facing change?

No. This is a documentation-only change. It documents a user-facing change that
was already made by SPARK-58517.

### How was this patch tested?

No tests; documentation only. The error condition names in the notes were
checked against the tree (`CONFLICTING_PIPELINE_FLOW_CASE_SENSITIVITY` in
`error-conditions.json`, `UNABLE_TO_INFER_PIPELINE_TABLE_SCHEMA` in
`GraphErrors.scala`), as was the "lowest flow identifier wins" rule
(`SchemaInferenceUtils.inferSchemaFromFlows` sorts by
`_.identifier.unquotedString`). The link form
`declarative-pipelines-programming-guide.html` matches the existing link in
`docs/index.md`.

### Was this patch authored or co-authored using generative AI tooling?

Generated-by: Claude Opus 5 (Cursor)

Closes #58222 from szehon-ho/docs-sdp-case-sensitivity-migration-note.

Authored-by: Szehon Ho <szehon.apache@gmail.com>
Signed-off-by: Szehon Ho <szehon.apache@gmail.com>
(cherry picked from commit 5a26f48)
Signed-off-by: Szehon Ho <szehon.apache@gmail.com>
szehon-ho added a commit that referenced this pull request Aug 24, 2026
… case sensitivity

### What changes were proposed in this pull request?

Adds two entries to the "Upgrading from Spark SQL 4.2 to 4.3" section of
`docs/sql-migration-guide.md`, documenting the behavior change made by
SPARK-58517 (#57722):

- Declarative Pipelines now honors `spark.sql.caseSensitive` when inferring and
  evolving pipeline table schemas. Under case-insensitive resolution (the
  default), column names differing only in case identify the same column, so
  flows contribute a single column rather than one per spelling, and the note
  states which spelling survives.
- All flows writing to one pipeline table must agree on the effective
  `spark.sql.caseSensitive`, or the update fails with the new
  `CONFLICTING_PIPELINE_FLOW_CASE_SENSITIVITY` error condition.

Documentation only; no code change.

### Why are the changes needed?

SPARK-58517 first ships in 4.3.0 (merged to `master`, `branch-4.x`, and
`branch-4.3`), and the behavior it changed has been in place since 4.1.0:
`SchemaMergingUtils.mergeSchemas` merged positionally, leaving
`StructType.merge`'s `caseSensitive = true` default; `DataflowGraph.inferredSchema`
merged with `reduce(SchemaMergingUtils.mergeSchemas)`; and
`SchemaInferenceUtils.diffSchemas` keyed columns on exact field names. Users
upgrading from 4.1.x or 4.2.x will see two observable differences that a
migration note should cover:

- A target schema that previously evolved to carry both spellings, then failed
  later with errors such as `COLUMN_ALREADY_EXISTS` or `AMBIGUOUS_REFERENCE`,
  now folds into a single column.
- A pipeline whose flows disagree on `spark.sql.caseSensitive` now fails up
  front with `CONFLICTING_PIPELINE_FLOW_CASE_SENSITIVITY`.

### Does this PR introduce _any_ user-facing change?

No. This is a documentation-only change. It documents a user-facing change that
was already made by SPARK-58517.

### How was this patch tested?

No tests; documentation only. The error condition names in the notes were
checked against the tree (`CONFLICTING_PIPELINE_FLOW_CASE_SENSITIVITY` in
`error-conditions.json`, `UNABLE_TO_INFER_PIPELINE_TABLE_SCHEMA` in
`GraphErrors.scala`), as was the "lowest flow identifier wins" rule
(`SchemaInferenceUtils.inferSchemaFromFlows` sorts by
`_.identifier.unquotedString`). The link form
`declarative-pipelines-programming-guide.html` matches the existing link in
`docs/index.md`.

### Was this patch authored or co-authored using generative AI tooling?

Generated-by: Claude Opus 5 (Cursor)

Closes #58222 from szehon-ho/docs-sdp-case-sensitivity-migration-note.

Authored-by: Szehon Ho <szehon.apache@gmail.com>
Signed-off-by: Szehon Ho <szehon.apache@gmail.com>
(cherry picked from commit 5a26f48)
Signed-off-by: Szehon Ho <szehon.apache@gmail.com>
@szehon-ho

Copy link
Copy Markdown
Member Author

Merge Summary:

Posted by merge_spark_pr.py

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants