wgtmac commented on code in PR #401:
URL: https://github.com/apache/iceberg-cpp/pull/401#discussion_r2646479734
##########
src/iceberg/transform.cc:
##########
@@ -388,6 +388,29 @@ std::string Transform::ToString() const {
std::unreachable();
}
+Result<std::string> Transform::GeneratePartitionName(std::string_view
source_name) const {
+ switch (transform_type_) {
+ case TransformType::kIdentity:
+ return std::string(source_name);
+ case TransformType::kBucket:
+ // Format: sourceName_bucket_N (matching Java: sourceName + "_bucket_" +
numBuckets)
Review Comment:
```suggestion
```
I think this is obvious enough.
##########
src/iceberg/transform.cc:
##########
@@ -388,6 +388,29 @@ std::string Transform::ToString() const {
std::unreachable();
}
+Result<std::string> Transform::GeneratePartitionName(std::string_view
source_name) const {
+ switch (transform_type_) {
+ case TransformType::kIdentity:
+ return std::string(source_name);
+ case TransformType::kBucket:
+ // Format: sourceName_bucket_N (matching Java: sourceName + "_bucket_" +
numBuckets)
+ return std::format("{}_bucket_{}", source_name,
std::get<int32_t>(param_));
+ case TransformType::kTruncate:
+ // Format: sourceName_trunc_N (matching Java: sourceName + "_trunc_" +
width)
Review Comment:
```suggestion
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]