anoopj commented on code in PR #19076:
URL: https://github.com/apache/iceberg/pull/19076#discussion_r4654013849
##########
core/src/test/java/org/apache/iceberg/TestTrackedFileStruct.java:
##########
@@ -171,7 +171,7 @@ void getByPosition() {
assertThat(file.get(pos("content_type"),
Integer.class)).isEqualTo(FileContent.DATA.id());
assertThat(file.get(pos("location"), String.class))
.isEqualTo("s3://bucket/data/00000-0-file.parquet");
- assertThat(file.get(pos("file_format"),
String.class)).isEqualTo(FileFormat.PARQUET.toString());
+ assertThat(file.get(pos("file_format"),
String.class)).isEqualTo("parquet");
Review Comment:
I agree we don't need to change `rawRead`. We can just add a test with mocks
- we already have a bunch of tests in `TestV4TrackedFileWrappers` to test
wrapper output.
```java
@Test
void leafWritesLowerCaseFileFormat() {
TrackedFile file = mock(TrackedFile.class);
when(file.contentType()).thenReturn(FileContent.DATA);
when(file.location()).thenReturn(DATA_LOCATION);
when(file.fileFormat()).thenReturn(FileFormat.PARQUET);
LeafTrackedFileWrapper wrapper =
new LeafTrackedFileWrapper(
[...]
StructLike row = wrapper.wrap(file,....);
assertThat(get(row, TRACKED_FILE_SCHEMA,
TrackedFile.FILE_FORMAT)).isEqualTo("parquet");
}
```
We should also probably add a similar `rootWritesLowerCaseFileFormat` and
`rootWritesLowerCaseColumnFileFormat` as well.
--
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]