-
Notifications
You must be signed in to change notification settings - Fork 3.9k
[feature](iceberg) Support nested column schema change #65329
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
36 commits
Select commit
Hold shift + click to select a range
40aea36
[feature](iceberg) Support nested column schema change
hubgeter 6dbe65c
[fix](iceberg) Fix nested schema evolution CI failures
hubgeter 5464675
[fix](iceberg) Reject case-insensitive nested field collisions
hubgeter 4641e4a
[fix](iceberg) Address nested schema evolution review gaps
hubgeter a16c6b2
[test](iceberg) Verify nested column comment updates
hubgeter 5831ec0
[fix](iceberg) Support direct nested element comments
hubgeter 49f7fa3
[fix](iceberg) Reject duplicate appended struct fields
hubgeter d91fb53
[fix](iceberg) Address nested schema review findings
hubgeter ca388a4
[fix](iceberg) Preserve requiredness in column modifications
hubgeter 013a3b0
[fix](iceberg) Reject unsupported nested column clauses
hubgeter e6911fa
[fix](iceberg) Reject unsupported column default metadata
hubgeter 8ef56e7
[fix](iceberg) Reject ignored column clauses
hubgeter df75fc8
[fix](fe) Align row binlog hidden-key test with TSO
hubgeter 3515e1d
[fix](iceberg) Harden nested schema evolution validation
hubgeter 30176e3
[fix](fe) Resolve row binlog schema test conflict
hubgeter 9c2496a
[fix](iceberg) Fix schema evolution validation failures
hubgeter 7383b6b
[fix](iceberg) Preserve nested schema alter semantics
hubgeter 1805aad
[fix](iceberg) Address nested schema evolution review issues
hubgeter c1d9268
[fix](iceberg) Fix nested default BE test compilation
hubgeter a8705b4
[fix](iceberg) Preserve mapped types in column modifications
hubgeter 459f596
[fix](iceberg) Harden column schema change validation
hubgeter 9c5401d
[fix](iceberg) Preserve schema change validation compatibility
hubgeter 92f882e
[fix](iceberg) Align complex schema regression expectation
hubgeter 15ff18e
[fix](fe) Fix LogicalPlanBuilder declaration order
hubgeter 6c7dc87
[fix](iceberg) Reject unsupported collection comments
hubgeter 900b4b5
[fix](iceberg) Preserve explicit empty comment intent
hubgeter c000f06
[fix](iceberg) Preserve struct member comments
hubgeter 1eb8cc8
[fix](iceberg) Preserve column path identity in schema changes
hubgeter 05f39ca
[fix](iceberg) Preserve unspecified nested field comments
hubgeter 22996d4
[fix](iceberg) Fix schema evolution regression checks
hubgeter 6a88d6c
[test](iceberg) Add nested schema evolution coverage
hubgeter de487eb
[chore](iceberg) Merge latest master
hubgeter fe5bf11
[fix](iceberg) Address nested schema review feedback
hubgeter b7c279c
[chore](iceberg) Merge latest master
hubgeter c49d90f
[fix](iceberg) Reject non-atomic compound column changes
hubgeter 7ebdcf9
[fix](iceberg) Preserve identifier metadata during nested renames
hubgeter File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
92 changes: 92 additions & 0 deletions
92
fe/fe-core/src/main/java/org/apache/doris/analysis/ColumnPath.java
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,92 @@ | ||
| // Licensed to the Apache Software Foundation (ASF) under one | ||
| // or more contributor license agreements. See the NOTICE file | ||
| // distributed with this work for additional information | ||
| // regarding copyright ownership. The ASF licenses this file | ||
| // to you under the Apache License, Version 2.0 (the | ||
| // "License"); you may not use this file except in compliance | ||
| // with the License. You may obtain a copy of the License at | ||
| // | ||
| // http://www.apache.org/licenses/LICENSE-2.0 | ||
| // | ||
| // Unless required by applicable law or agreed to in writing, | ||
| // software distributed under the License is distributed on an | ||
| // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
| // KIND, either express or implied. See the License for the | ||
| // specific language governing permissions and limitations | ||
| // under the License. | ||
|
|
||
| package org.apache.doris.analysis; | ||
|
|
||
| import org.apache.doris.common.util.SqlUtils; | ||
|
|
||
| import com.google.common.base.Preconditions; | ||
| import com.google.common.collect.ImmutableList; | ||
|
|
||
| import java.util.Arrays; | ||
| import java.util.List; | ||
| import java.util.stream.Collectors; | ||
|
|
||
| /** | ||
| * Represents a column path used by schema change statements. | ||
| */ | ||
| public class ColumnPath { | ||
| private final ImmutableList<String> parts; | ||
|
|
||
| private ColumnPath(List<String> parts) { | ||
| Preconditions.checkArgument(parts != null && !parts.isEmpty(), "column path is empty"); | ||
| for (String part : parts) { | ||
| Preconditions.checkArgument(part != null && !part.isEmpty(), "column path contains empty part"); | ||
| } | ||
| this.parts = ImmutableList.copyOf(parts); | ||
| } | ||
|
|
||
| public static ColumnPath of(List<String> parts) { | ||
| return new ColumnPath(parts); | ||
| } | ||
|
|
||
| public static ColumnPath of(String name) { | ||
| return new ColumnPath(ImmutableList.of(name)); | ||
| } | ||
|
|
||
| public static ColumnPath fromDotName(String name) { | ||
| return new ColumnPath(Arrays.asList(name.split("\\."))); | ||
| } | ||
|
|
||
| public List<String> getParts() { | ||
| return parts; | ||
| } | ||
|
|
||
| public boolean isNested() { | ||
| return parts.size() > 1; | ||
| } | ||
|
|
||
| public String getTopLevelName() { | ||
| return parts.get(0); | ||
| } | ||
|
|
||
| public String getLeafName() { | ||
| return parts.get(parts.size() - 1); | ||
| } | ||
|
|
||
| public ColumnPath getParentPath() { | ||
| Preconditions.checkState(isNested(), "top-level column path has no parent"); | ||
| return new ColumnPath(parts.subList(0, parts.size() - 1)); | ||
| } | ||
|
|
||
| public String getParentPathString() { | ||
| return getParentPath().getFullPath(); | ||
| } | ||
|
|
||
| public String getFullPath() { | ||
| return String.join(".", parts); | ||
| } | ||
|
|
||
| public String toSql() { | ||
| return parts.stream().map(SqlUtils::getIdentSql).collect(Collectors.joining(".")); | ||
| } | ||
|
|
||
| @Override | ||
| public String toString() { | ||
| return getFullPath(); | ||
| } | ||
| } | ||
This file contains hidden or 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 hidden or 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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ColumnPath.toSql()needs to escape the stored path parts, not just wrap them in backticks. After the parser fixes from the existing quoted-identifier comments, a valid path likeinfo.`MetricName`` will be stored as a component containing a backtick, but this method renders it as invalid SQL instead of doubling the embedded backtick. All of the new path-aware ALTER ops use this renderer, and the same round-trip problem exists forAFTERbecauseColumnPosition.toSql()wrapslastColwithout escaping, and for rename targets becauseRenameColumnOp.toSql()appendsnewColNameunquoted. Please use the normal identifier-quoting helper for all three renderers and add atoSql()`/round-trip test with escaped-backtick nested names, position references, and rename targets.