github-actions[bot] commented on code in PR #64754:
URL: https://github.com/apache/doris/pull/64754#discussion_r3461023258
##########
fe/fe-core/src/test/java/org/apache/doris/datasource/iceberg/IcebergUtilsTest.java:
##########
@@ -711,4 +712,33 @@ private void assertQueryInfo(
Assert.assertEquals(expectSchemaId, queryInfo.getSchemaId());
Assert.assertEquals(expectRef, queryInfo.getRef());
}
+
+ @Test
+ public void testGetFileFormatHonorsWriteFormatProperty() {
+ Table table = Mockito.mock(Table.class);
+
Mockito.when(table.properties()).thenReturn(ImmutableMap.of(IcebergUtils.WRITE_FORMAT,
"ORC"));
+ Assert.assertEquals(FileFormat.ORC, IcebergUtils.getFileFormat(table));
+ // No snapshot lookup should be needed when properties are sufficient.
+ Mockito.verify(table, Mockito.never()).currentSnapshot();
+ }
+
+ @Test
+ public void testGetFileFormatHonorsDefaultFormatProperty() {
+ Table table = Mockito.mock(Table.class);
Review Comment:
The main behavior this PR changes is the non-empty-snapshot fallback below
`inferFileFormatFromDataFiles`: when both format properties are missing, it
should read a data manifest and return that entry's `file_format`. The added
tests cover the property shortcuts and the `currentSnapshot() == null` default,
but none creates or mocks a non-null snapshot with a data manifest, so this new
branch can fall back to parquet or return the wrong value without a test
failing. Please add a focused unit test that reaches
`snapshot.dataManifests(io)` / `ManifestFiles.read(...).select(...)` and
asserts an ORC or Parquet manifest entry is returned.
--
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]