RussellSpitzer commented on code in PR #18935:
URL: https://github.com/apache/iceberg/pull/18935#discussion_r4619085495


##########
core/src/test/java/org/apache/iceberg/TestSchemaUpdate.java:
##########
@@ -2590,4 +2600,193 @@ public void 
testCaseInsensitiveMoveAfterNewlyAddedField() {
 
     assertThat(actual.asStruct()).isEqualTo(expected.asStruct());
   }
+
+  @Test
+  void cannotAddColumnToFileColumn() {
+    assertThatThrownBy(() -> fileUpdate().addColumn("photo", "extra", 
Types.StringType.get()))
+        .isInstanceOf(IllegalArgumentException.class)
+        .hasMessage("Cannot add to non-struct column: photo: file");
+  }
+
+  @Test
+  void cannotDeleteFileNestedField() {
+    assertThatThrownBy(() -> fileUpdate().deleteColumn("photo.checksum"))
+        .isInstanceOf(IllegalArgumentException.class)
+        .hasMessage("Cannot change a nested field of a file column: 
photo.checksum");
+  }
+
+  @Test
+  void cannotRenameFileNestedField() {
+    assertThatThrownBy(() -> fileUpdate().renameColumn("photo.uri", 
"location"))
+        .isInstanceOf(IllegalArgumentException.class)
+        .hasMessage("Cannot change a nested field of a file column: 
photo.uri");
+  }
+
+  @Test
+  void cannotPromoteFileNestedField() {
+    assertThatThrownBy(() -> fileUpdate().updateColumn("photo.size", 
Types.LongType.get()))

Review Comment:
   Sure, the name of the test is a bit confusing here. I'll switch the test 
name because you can't really promote any of these columns anyway. I'll just 
say "cannotUpdateFileNestedFieldTYpe"
   



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to