You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xtable.apache.org by "brishi19791 (via GitHub)" <gi...@apache.org> on 2025/05/09 21:44:50 UTC
[PR] Added a fix for column rename in IcebergSchemaSync [incubator-xtable]
brishi19791 opened a new pull request, #712:
URL: https://github.com/apache/incubator-xtable/pull/712
FIxes #711
--
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: commits-unsubscribe@xtable.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Added a fix for column rename in IcebergSchemaSync [incubator-xtable]
Posted by "brishi19791 (via GitHub)" <gi...@apache.org>.
brishi19791 commented on code in PR #712:
URL: https://github.com/apache/incubator-xtable/pull/712#discussion_r2082687240
##########
xtable-core/src/test/java/org/apache/xtable/iceberg/TestIcebergSchemaSync.java:
##########
@@ -335,6 +335,33 @@ void testAddMapFieldComment() {
verify(mockUpdateSchema).commit();
}
+ @Test
Review Comment:
I will take a look and will add it @vinishjail97
--
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: commits-unsubscribe@xtable.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Added a fix for column rename in IcebergSchemaSync [incubator-xtable]
Posted by "vinishjail97 (via GitHub)" <gi...@apache.org>.
vinishjail97 commented on code in PR #712:
URL: https://github.com/apache/incubator-xtable/pull/712#discussion_r2082586375
##########
xtable-core/src/test/java/org/apache/xtable/iceberg/TestIcebergSchemaSync.java:
##########
@@ -335,6 +335,33 @@ void testAddMapFieldComment() {
verify(mockUpdateSchema).commit();
}
+ @Test
Review Comment:
Can we add a unit test which writes an actual iceberg table to a tempDir path? There are many examples in `ITConversionController` to follow from.
##########
xtable-core/src/main/java/org/apache/xtable/iceberg/IcebergSchemaSync.java:
##########
@@ -114,6 +116,12 @@ private static Map<Integer, Supplier<UpdateSchema>> updateColumn(
String parentPath) {
Map<Integer, Supplier<UpdateSchema>> updates = new HashMap<>();
if (!latestColumn.equals(currentColumn)) {
+ // update the name of the column
+ if (!latestColumn.name().equals(currentColumn.name())) {
+ updates.put(
+ latestColumn.fieldId(),
+ () -> updateSchema.renameColumn(currentColumn.name(), latestColumn.name()));
+ }
Review Comment:
I think column name should be done after updating the type?
The UT's are failing are probably because of this.
--
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: commits-unsubscribe@xtable.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Added a fix for column rename in IcebergSchemaSync [incubator-xtable]
Posted by "brishi19791 (via GitHub)" <gi...@apache.org>.
brishi19791 commented on code in PR #712:
URL: https://github.com/apache/incubator-xtable/pull/712#discussion_r2082687458
##########
xtable-core/src/main/java/org/apache/xtable/iceberg/IcebergSchemaSync.java:
##########
@@ -114,6 +116,12 @@ private static Map<Integer, Supplier<UpdateSchema>> updateColumn(
String parentPath) {
Map<Integer, Supplier<UpdateSchema>> updates = new HashMap<>();
if (!latestColumn.equals(currentColumn)) {
+ // update the name of the column
+ if (!latestColumn.name().equals(currentColumn.name())) {
+ updates.put(
+ latestColumn.fieldId(),
+ () -> updateSchema.renameColumn(currentColumn.name(), latestColumn.name()));
+ }
Review Comment:
I moved after updating the type and still it is failing. I will take a look
--
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: commits-unsubscribe@xtable.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org