WZhuo commented on code in PR #437:
URL: https://github.com/apache/iceberg-cpp/pull/437#discussion_r2646499280
##########
src/iceberg/partition_spec.cc:
##########
@@ -155,6 +155,42 @@ Status PartitionSpec::Validate(const Schema& schema, bool
allow_missing_fields)
return {};
}
+Status PartitionSpec::ValidatePartitionName(const Schema& schema) const {
+ std::unordered_set<std::string> partition_names;
+ for (const auto& partition_field : fields_) {
+ auto name = std::string(partition_field.name());
+ if (name.empty()) {
+ return InvalidArgument("Cannot use empty partition name: {}", name);
+ }
Review Comment:
```suggestion
ICEBERG_PRECHECK(!partition_field.name().empty(), "Cannot use empty
partition name: {}", name);
auto name = std::string(partition_field.name());
```
--
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]