Skip to content

[Spark] Fix bug when renamimg column metadata with special chars - #5352

Merged
allisonport-db merged 1 commit into
delta-io:masterfrom
mkroll-db:fix_rename_column_metadata_special_chars
Oct 17, 2025
Merged

allisonport-db merged 1 commit into
delta-io:masterfrom
mkroll-db:fix_rename_column_metadata_special_chars

Conversation

@mkroll-db

Copy link
Copy Markdown
Collaborator

Which Delta project/connector is this regarding?

  • Spark
  • Standalone
  • Flink
  • Kernel
  • Other (fill in here)

Description

It fixes a problem with renaming columns with dataSkipping enabled.

Currently the following column rename will fail

create or replace table main.default.delta_rename_test (c int) tblproperties ("delta.columnMapping.mode" = "name", "delta.dataSkippingStatsColumns" = "c");
alter table main.default.delta_rename_test rename column c to `c#2`;

This PR addresses the issue.

How was this patch tested?

Tests were added to DeltaColumnRenameSuite.scala

Does this PR introduce any user-facing changes?

No

@allisonport-db
allisonport-db merged commit 1dd28aa into delta-io:master Oct 17, 2025
27 checks passed
@mkroll-db
mkroll-db deleted the fix_rename_column_metadata_special_chars branch October 23, 2025 09:16
huashi-st pushed a commit to huashi-st/delta that referenced this pull request Apr 24, 2026
…ta-io#5352)

<!--
Thanks for sending a pull request!  Here are some tips for you:
1. If this is your first time, please read our contributor guidelines:
https://github.com/delta-io/delta/blob/master/CONTRIBUTING.md
2. If the PR is unfinished, add '[WIP]' in your PR title, e.g., '[WIP]
Your PR title ...'.
  3. Be sure to keep the PR description updated to reflect all changes.
  4. Please write your PR title to summarize what this PR proposes.
5. If possible, provide a concise example to reproduce the issue for a
faster review.
6. If applicable, include the corresponding issue number in the PR title
and link it in the body.
-->

#### Which Delta project/connector is this regarding?
<!--
Please add the component selected below to the beginning of the pull
request title
For example: [Spark] Title of my pull request
-->

- [x] Spark
- [ ] Standalone
- [ ] Flink
- [ ] Kernel
- [ ] Other (fill in here)

## Description
It fixes a problem with renaming columns with `dataSkipping` enabled. 

Currently the following column rename will fail
```sql
create or replace table main.default.delta_rename_test (c int) tblproperties ("delta.columnMapping.mode" = "name", "delta.dataSkippingStatsColumns" = "c");
alter table main.default.delta_rename_test rename column c to `c#2`;
```
This PR addresses the issue.

<!--
- Describe what this PR changes.
- Describe why we need the change.
 
If this PR resolves an issue be sure to include "Resolves #XXX" to
correctly link and close the issue upon merge.
-->

## How was this patch tested?
Tests were added to
[DeltaColumnRenameSuite.scala](spark/src/test/scala/org/apache/spark/sql/delta/DeltaColumnRenameSuite.scala)

<!--
If tests were added, say they were added here. Please make sure to test
the changes thoroughly including negative and positive cases if
possible.
If the changes were tested in any way other than unit tests, please
clarify how you tested step by step (ideally copy and paste-able, so
that other reviewers can test and check, and descendants can verify in
the future).
If the changes were not tested, please explain why.
-->

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

<!--
If yes, please clarify the previous behavior and the change this PR
proposes - provide the console output, description and/or an example to
show the behavior difference if possible.
If possible, please also clarify if this is a user-facing change
compared to the released Delta Lake versions or within the unreleased
branches such as master.
If no, write 'No'.
-->
No


<!--
Please read [go/dbr-dev-guides](https://go/dbr-dev-guides/) before
creating a pull request against files shared between Databricks Runtime
and open-source Apache Spark.
For example, this includes files under the `org.apache.spark` package
path.
If in doubt, please reach out to a member of the open-source team for
help.
-->
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.

3 participants