You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Kernel] Support column mapping mode in REPLACE TABLE including with fieldId re-use (#4518)
<!--
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
-->
- [ ] Spark
- [ ] Standalone
- [ ] Flink
- [x] Kernel
- [ ] Other (fill in here)
## Description
PR#1 here #4520 separates some of
this out.
This PR re-enables support for column mapping tables with REPLACE, and
allows fieldId re-use when the type/nullability is compatible. To check
for this compatibility we essentially re-use our schema evolution code.
Valid schema transformations in the normal case should also be valid
changes when reusing fieldIds across REPLACE. Any fields in the
replaceSchema that are not reusing existing fieldIds will be treated as
new fields during the schema evolution validation.
This validation checks that nullability changes are valid (cannot change
from nullable to non-nullable) and that type changes are valid (for now,
cannot change types). Columns are able to be moved (or nested columns
dropped) if the other invariants hold.
Note, this currently restricts REPLACE to operations that maintain the
same column mapping mode. In the future, we will loosen this restriction
but for now this lessens the scope of this PR.
## How was this patch tested?
Adds unit tests.
0 commit comments