-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Spark] Fix char/varchar to string column conversions
Users are currently allowed to change the data type of their columns from char/varchar to string. Even though the command succeeds, the column metadata that indicates that the column is char/varchar is not removed during the process. As a result, Delta enforces the old char/varchar constraints on future inserts. This PR fixes that by removing this metadata from any updated char/varchar column when the column is updated. ## How was this patch tested? Added a new test which was failing without the code fix. ## Does this PR introduce _any_ user-facing changes? Yes, `ALTER COLUMN X TYPE STRING;` will now work correctly when X is char/varchar.
- Loading branch information
1 parent
4456a12
commit 9a59c0a
Showing
2 changed files
with
26 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters