|
24 | 24 | import org.apache.paimon.data.InternalRow; |
25 | 25 | import org.apache.paimon.disk.IOManager; |
26 | 26 | import org.apache.paimon.fs.Path; |
| 27 | +import org.apache.paimon.io.DataFileMeta; |
27 | 28 | import org.apache.paimon.manifest.PartitionEntry; |
28 | 29 | import org.apache.paimon.metrics.MetricRegistry; |
29 | 30 | import org.apache.paimon.options.Options; |
|
44 | 45 | import org.apache.paimon.utils.Preconditions; |
45 | 46 | import org.apache.paimon.utils.SegmentsCache; |
46 | 47 |
|
| 48 | +import org.slf4j.Logger; |
| 49 | +import org.slf4j.LoggerFactory; |
| 50 | + |
47 | 51 | import java.io.IOException; |
48 | 52 | import java.util.ArrayList; |
49 | 53 | import java.util.HashMap; |
|
60 | 64 | */ |
61 | 65 | public class FallbackReadFileStoreTable extends DelegatedFileStoreTable { |
62 | 66 |
|
| 67 | + private static final Logger LOG = LoggerFactory.getLogger(FallbackReadFileStoreTable.class); |
| 68 | + |
63 | 69 | private final FileStoreTable fallback; |
64 | 70 |
|
65 | 71 | public FallbackReadFileStoreTable(FileStoreTable wrapped, FileStoreTable fallback) { |
@@ -397,10 +403,17 @@ public RecordReader<InternalRow> createReader(Split split) throws IOException { |
397 | 403 | DataSplit dataSplit = (DataSplit) split; |
398 | 404 | if (!dataSplit.dataFiles().isEmpty() |
399 | 405 | && dataSplit.dataFiles().get(0).minKey().getFieldCount() > 0) { |
400 | | - return fallbackRead.createReader(split); |
401 | | - } else { |
402 | | - return mainRead.createReader(split); |
| 406 | + try { |
| 407 | + return fallbackRead.createReader(split); |
| 408 | + } catch (Exception ignored) { |
| 409 | + LOG.error( |
| 410 | + "Reading from fallback branch has problems for files: {}", |
| 411 | + dataSplit.dataFiles().stream() |
| 412 | + .map(DataFileMeta::fileName) |
| 413 | + .collect(Collectors.joining(", "))); |
| 414 | + } |
403 | 415 | } |
| 416 | + return mainRead.createReader(split); |
404 | 417 | } |
405 | 418 | } |
406 | 419 | } |
0 commit comments