|
41 | 41 | import org.apache.paimon.catalog.CatalogFactory; |
42 | 42 | import org.apache.paimon.catalog.Identifier; |
43 | 43 | import org.apache.paimon.data.InternalRow; |
44 | | -import org.apache.paimon.io.DataFileMeta; |
45 | 44 | import org.apache.paimon.options.Options; |
46 | 45 | import org.apache.paimon.schema.Schema; |
47 | 46 | import org.apache.paimon.table.FileStoreTable; |
|
80 | 79 | import static org.apache.fluss.record.ChangeType.INSERT; |
81 | 80 | import static org.apache.fluss.record.ChangeType.UPDATE_AFTER; |
82 | 81 | import static org.apache.fluss.record.ChangeType.UPDATE_BEFORE; |
83 | | -import static org.apache.fluss.utils.Preconditions.checkState; |
84 | 82 | import static org.assertj.core.api.Assertions.assertThat; |
85 | 83 |
|
86 | 84 | /** The UT for tiering to Paimon via {@link PaimonLakeTieringFactory}. */ |
@@ -624,12 +622,17 @@ private CloseableIterator<InternalRow> getPaimonRows( |
624 | 622 | // for log table, we can't filter by bucket directly, filter file by __bucket column |
625 | 623 | for (Split split : readBuilder.newScan().plan().splits()) { |
626 | 624 | DataSplit dataSplit = (DataSplit) split; |
627 | | - List<DataFileMeta> dataFileMetas = dataSplit.dataFiles(); |
628 | | - checkState(dataFileMetas.size() == 1); |
629 | | - DataFileMeta dataFileMeta = dataFileMetas.get(0); |
630 | | - // filter by __bucket column |
631 | | - if (dataFileMeta.valueStats().maxValues().getInt(3) == bucket |
632 | | - && dataFileMeta.valueStats().minValues().getInt(3) == bucket) { |
| 625 | + // bucket is always 0 |
| 626 | + assertThat(dataSplit.bucket()).isEqualTo(0); |
| 627 | + // filter by __bucket column, remove any data file that don't belone to this bucket |
| 628 | + dataSplit |
| 629 | + .dataFiles() |
| 630 | + .removeIf( |
| 631 | + dataFileMeta -> |
| 632 | + !(dataFileMeta.valueStats().maxValues().getInt(3) == bucket |
| 633 | + && dataFileMeta.valueStats().minValues().getInt(3) |
| 634 | + == bucket)); |
| 635 | + if (!dataSplit.dataFiles().isEmpty()) { |
633 | 636 | splits.add(split); |
634 | 637 | } |
635 | 638 | } |
|
0 commit comments