Skip to content

Commit 8332390

Browse files
committed
Make raw file path factory explicit
1 parent af12574 commit 8332390

2 files changed

Lines changed: 17 additions & 6 deletions

File tree

src/paimon/core/operation/raw_file_split_read.cpp

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,16 +76,21 @@ Result<std::unique_ptr<BatchReader>> RawFileSplitRead::CreateReader(
7676
dv_factory, data_file_path_factory);
7777
}
7878

79+
Result<std::unique_ptr<BatchReader>> RawFileSplitRead::CreateReader(
80+
const BinaryRow& partition, int32_t bucket,
81+
const std::vector<std::shared_ptr<DataFileMeta>>& data_files,
82+
DeletionVector::Factory dv_factory) {
83+
PAIMON_ASSIGN_OR_RAISE(std::shared_ptr<DataFilePathFactory> data_file_path_factory,
84+
path_factory_->CreateDataFilePathFactory(partition, bucket));
85+
return CreateReader(partition, bucket, data_files, dv_factory, data_file_path_factory);
86+
}
87+
7988
Result<std::unique_ptr<BatchReader>> RawFileSplitRead::CreateReader(
8089
const BinaryRow& partition, int32_t bucket,
8190
const std::vector<std::shared_ptr<DataFileMeta>>& data_files,
8291
DeletionVector::Factory dv_factory,
8392
std::shared_ptr<DataFilePathFactory> data_file_path_factory) {
8493
const auto& predicate = context_->GetPredicate();
85-
if (!data_file_path_factory) {
86-
PAIMON_ASSIGN_OR_RAISE(data_file_path_factory,
87-
path_factory_->CreateDataFilePathFactory(partition, bucket));
88-
}
8994

9095
PAIMON_ASSIGN_OR_RAISE(
9196
std::vector<std::unique_ptr<FileBatchReader>> raw_file_readers,

src/paimon/core/operation/raw_file_split_read.h

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,8 @@ class RawFileSplitRead : public AbstractSplitRead {
7070

7171
Result<std::unique_ptr<BatchReader>> CreateReader(
7272
const BinaryRow& partition, int32_t bucket,
73-
const std::vector<std::shared_ptr<DataFileMeta>>& files, DeletionVector::Factory dv_factory,
74-
std::shared_ptr<DataFilePathFactory> data_file_path_factory = nullptr);
73+
const std::vector<std::shared_ptr<DataFileMeta>>& files,
74+
DeletionVector::Factory dv_factory);
7575

7676
Result<bool> Match(const std::shared_ptr<Split>& split, bool force_keep_delete) const override;
7777

@@ -82,6 +82,12 @@ class RawFileSplitRead : public AbstractSplitRead {
8282
const std::shared_ptr<Predicate>& predicate, DeletionVector::Factory dv_factory,
8383
const std::optional<std::vector<Range>>& ranges,
8484
const std::shared_ptr<DataFilePathFactory>& data_file_path_factory) const override;
85+
86+
private:
87+
Result<std::unique_ptr<BatchReader>> CreateReader(
88+
const BinaryRow& partition, int32_t bucket,
89+
const std::vector<std::shared_ptr<DataFileMeta>>& files, DeletionVector::Factory dv_factory,
90+
std::shared_ptr<DataFilePathFactory> data_file_path_factory);
8591
};
8692

8793
} // namespace paimon

0 commit comments

Comments
 (0)