Skip to content

Commit

Permalink
fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
zhztheplayer committed Feb 28, 2025
1 parent eae4ff4 commit 4f362da
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 16 deletions.
21 changes: 15 additions & 6 deletions velox/connectors/hive/HiveConnectorSplit.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,29 +79,30 @@ struct HiveConnectorSplit : public connector::ConnectorSplit {
const std::unordered_map<std::string, std::optional<std::string>>&
_partitionKeys = {},
std::optional<int32_t> _tableBucketNumber = std::nullopt,
std::optional<HiveBucketConversion> _bucketConversion = std::nullopt,
const std::unordered_map<std::string, std::string>& _customSplitInfo = {},
const std::shared_ptr<std::string>& _extraFileInfo = {},
const std::unordered_map<std::string, std::string>& _serdeParameters = {},
int64_t splitWeight = 0,
bool cacheable = true,
const std::unordered_map<std::string, std::string>& _infoColumns = {},
std::optional<FileProperties> _properties = std::nullopt,
std::optional<RowIdProperties> _rowIdProperties = std::nullopt)
std::optional<RowIdProperties> _rowIdProperties = std::nullopt,
const std::optional<HiveBucketConversion>& _bucketConversion =
std::nullopt)
: ConnectorSplit(connectorId, splitWeight, cacheable),
filePath(_filePath),
fileFormat(_fileFormat),
start(_start),
length(_length),
partitionKeys(_partitionKeys),
tableBucketNumber(_tableBucketNumber),
bucketConversion(std::move(_bucketConversion)),
customSplitInfo(_customSplitInfo),
extraFileInfo(_extraFileInfo),
serdeParameters(_serdeParameters),
infoColumns(_infoColumns),
properties(_properties),
rowIdProperties(_rowIdProperties) {}
rowIdProperties(_rowIdProperties),
bucketConversion(_bucketConversion) {}

std::string toString() const override;

Expand Down Expand Up @@ -200,6 +201,12 @@ class HiveConnectorSplitBuilder {
return *this;
}

HiveConnectorSplitBuilder& rowIdProperties(
const RowIdProperties& rowIdProperties) {
rowIdProperties_ = rowIdProperties;
return *this;
}

std::shared_ptr<connector::hive::HiveConnectorSplit> build() const {
return std::make_shared<connector::hive::HiveConnectorSplit>(
connectorId_,
Expand All @@ -209,14 +216,15 @@ class HiveConnectorSplitBuilder {
length_,
partitionKeys_,
tableBucketNumber_,
bucketConversion_,
customSplitInfo_,
extraFileInfo_,
serdeParameters_,
splitWeight_,
cacheable_,
infoColumns_,
fileProperties_);
fileProperties_,
rowIdProperties_,
bucketConversion_);
}

private:
Expand All @@ -235,6 +243,7 @@ class HiveConnectorSplitBuilder {
int64_t splitWeight_{0};
bool cacheable_{true};
std::optional<FileProperties> fileProperties_;
std::optional<RowIdProperties> rowIdProperties_ = std::nullopt;
};

} // namespace facebook::velox::connector::hive
12 changes: 6 additions & 6 deletions velox/connectors/hive/iceberg/IcebergSplit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ HiveIcebergSplit::HiveIcebergSplit(
const std::unordered_map<std::string, std::optional<std::string>>&
partitionKeys,
std::optional<int32_t> tableBucketNumber,
std::optional<HiveBucketConversion> bucketConversion,
const std::unordered_map<std::string, std::string>& customSplitInfo,
const std::shared_ptr<std::string>& extraFileInfo,
bool cacheable,
Expand All @@ -45,14 +44,15 @@ HiveIcebergSplit::HiveIcebergSplit(
length,
partitionKeys,
tableBucketNumber,
std::move(bucketConversion),
customSplitInfo,
extraFileInfo,
{},
/*splitWeight=*/0,
cacheable,
infoColumns,
properties) {
properties,
std::nullopt,
std::nullopt) {
// TODO: Deserialize _extraFileInfo to get deleteFiles;
}

Expand All @@ -66,7 +66,6 @@ HiveIcebergSplit::HiveIcebergSplit(
const std::unordered_map<std::string, std::optional<std::string>>&
partitionKeys,
std::optional<int32_t> tableBucketNumber,
std::optional<HiveBucketConversion> bucketConversion,
const std::unordered_map<std::string, std::string>& customSplitInfo,
const std::shared_ptr<std::string>& extraFileInfo,
bool cacheable,
Expand All @@ -81,13 +80,14 @@ HiveIcebergSplit::HiveIcebergSplit(
length,
partitionKeys,
tableBucketNumber,
std::move(bucketConversion),
customSplitInfo,
extraFileInfo,
{},
0,
cacheable,
infoColumns,
properties),
properties,
std::nullopt,
std::nullopt),
deleteFiles(std::move(deletes)) {}
} // namespace facebook::velox::connector::hive::iceberg
2 changes: 0 additions & 2 deletions velox/connectors/hive/iceberg/IcebergSplit.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ struct HiveIcebergSplit : public connector::hive::HiveConnectorSplit {
const std::unordered_map<std::string, std::optional<std::string>>&
partitionKeys = {},
std::optional<int32_t> tableBucketNumber = std::nullopt,
std::optional<HiveBucketConversion> bucketConversion = std::nullopt,
const std::unordered_map<std::string, std::string>& customSplitInfo = {},
const std::shared_ptr<std::string>& extraFileInfo = {},
bool cacheable = true,
Expand All @@ -52,7 +51,6 @@ struct HiveIcebergSplit : public connector::hive::HiveConnectorSplit {
const std::unordered_map<std::string, std::optional<std::string>>&
partitionKeys = {},
std::optional<int32_t> tableBucketNumber = std::nullopt,
std::optional<HiveBucketConversion> bucketConversion = std::nullopt,
const std::unordered_map<std::string, std::string>& customSplitInfo = {},
const std::shared_ptr<std::string>& extraFileInfo = {},
bool cacheable = true,
Expand Down
1 change: 0 additions & 1 deletion velox/connectors/hive/iceberg/tests/IcebergReadTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,6 @@ class HiveIcebergTest : public HiveConnectorTestBase {
splitSize,
partitionKeys,
std::nullopt,
std::nullopt,
customSplitInfo,
nullptr,
/*cacheable=*/true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ IcebergSplitReaderBenchmark::makeIcebergSplit(
fileSize,
partitionKeys,
std::nullopt,
std::nullopt,
customSplitInfo,
nullptr,
/*cacheable=*/true,
Expand Down

0 comments on commit 4f362da

Please sign in to comment.