You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2022/12/02 03:12:14 UTC

[GitHub] [flink-table-store] JingsongLi commented on a diff in pull request #347: [FLINK-27847] Support rename/drop column in SchemaManager

JingsongLi commented on code in PR #347:
URL: https://github.com/apache/flink-table-store/pull/347#discussion_r1036924742


##########
flink-table-store-core/src/main/java/org/apache/flink/table/store/file/schema/SchemaManager.java:
##########
@@ -221,6 +217,52 @@ public TableSchema commitChanges(List<SchemaChange> changes) throws Exception {
                     newFields.add(
                             new DataField(
                                     id, addColumn.fieldName(), dataType, addColumn.description()));
+                } else if (change instanceof RenameColumn) {
+                    RenameColumn rename = (RenameColumn) change;
+                    /// TODO support partition schema evolution
+                    if (schema.partitionKeys().contains(rename.fieldName())) {

Review Comment:
   Extract a method `validateNotPkAndPartKey`?



##########
flink-table-store-spark/src/test/java/org/apache/flink/table/store/spark/SparkReadITCase.java:
##########
@@ -284,6 +289,204 @@ public void testAddColumn() throws Exception {
         assertThat(results.toString()).isEqualTo("[[8]]");
     }
 
+    @Test
+    public void testRenameColumn() throws Exception {

Review Comment:
   Maybe we can create a new class `SparkSchemaChangeITCase`?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org