Skip to content

Commit cd232aa

Browse files
committed
[fix](test) Preserve Iceberg split format coverage after rebase
1 parent efb8461 commit cd232aa

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

‎fe/fe-core/src/test/java/org/apache/doris/datasource/iceberg/source/IcebergScanNodeTest.java‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -539,6 +539,26 @@ public void testSetIcebergParamsKeepsDeletionVectorOffsetAsLong() throws Excepti
539539
Assert.assertEquals((long) Integer.MAX_VALUE + 7L, deleteFileDesc.getContentSizeInBytes());
540540
}
541541

542+
@Test
543+
public void testSetIcebergParamsUsesSplitFileFormat() throws Exception {
544+
TestIcebergScanNode node = new TestIcebergScanNode(new SessionVariable());
545+
String dataPath = "file:///tmp/data-file.orc";
546+
IcebergSplit split = new IcebergSplit(LocationPath.of(dataPath), 0, 128, 128, new String[0],
547+
2, Collections.emptyMap(), new ArrayList<>(), dataPath);
548+
split.setTableFormatType(TableFormatType.ICEBERG);
549+
split.setSplitFileFormat(FileFormat.ORC);
550+
551+
Method method = IcebergScanNode.class.getDeclaredMethod("setIcebergParams",
552+
TFileRangeDesc.class, IcebergSplit.class);
553+
method.setAccessible(true);
554+
555+
TFileRangeDesc rangeDesc = new TFileRangeDesc();
556+
method.invoke(node, rangeDesc, split);
557+
558+
// Iceberg tables may mix file formats, so each range must preserve its split format.
559+
Assert.assertEquals(TFileFormatType.FORMAT_ORC, rangeDesc.getFormatType());
560+
}
561+
542562
@Test
543563
public void testPositionDeleteSystemTableValidatesDeletionVectorMetadata() throws Exception {
544564
DeleteFile deleteFile = Mockito.mock(DeleteFile.class);

0 commit comments

Comments
 (0)