Skip to content

Commit 2e79a5b

Browse files
authored
feat: add Bucket() virtual interface to DataSplit base class (alibaba#339)
1 parent 8f996d3 commit 2e79a5b

3 files changed

Lines changed: 8 additions & 1 deletion

File tree

include/paimon/table/source/data_split.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,9 @@ class PAIMON_EXPORT DataSplit : public Split {
7474
std::string ToString() const;
7575
};
7676

77+
/// Get the bucket id of this data split.
78+
virtual int32_t Bucket() const = 0;
79+
7780
/// Get the list of metadata for all data files in this split.
7881
/// @note This method will be removed in future versions and is only used for append tables.
7982
virtual std::vector<SimpleDataFileMeta> GetFileList() const = 0;

src/paimon/core/table/source/data_split_impl.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ class DataSplitImpl : public DataSplit {
5151
return partition_;
5252
}
5353

54-
int32_t Bucket() const {
54+
int32_t Bucket() const override {
5555
return bucket_;
5656
}
5757

src/paimon/core/table/source/fallback_data_split.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ class FallbackDataSplit : public DataSplit {
2727
FallbackDataSplit(const std::shared_ptr<DataSplit>& split, bool is_fallback)
2828
: is_fallback_(is_fallback), split_(split) {}
2929

30+
int32_t Bucket() const override {
31+
return split_->Bucket();
32+
}
33+
3034
std::vector<SimpleDataFileMeta> GetFileList() const override {
3135
return split_->GetFileList();
3236
}

0 commit comments

Comments
 (0)