wgtmac commented on code in PR #450:
URL: https://github.com/apache/iceberg-cpp/pull/450#discussion_r2652359817
##########
src/iceberg/schema.cc:
##########
@@ -34,11 +35,80 @@
namespace iceberg {
-Schema::Schema(std::vector<SchemaField> fields, std::optional<int32_t>
schema_id,
- std::vector<int32_t> identifier_field_ids)
- : StructType(std::move(fields)),
- schema_id_(schema_id),
- identifier_field_ids_(std::move(identifier_field_ids)) {}
+namespace {
+Status ValidateIdentifierFields(
Review Comment:
How about defining it as a class static function? I think it will be used in
the SchemaUpdate action.
<img width="1368" height="322" alt="image"
src="https://github.com/user-attachments/assets/1b37deed-0982-4d96-bf50-3fdc0c295472"
/>
##########
src/iceberg/schema.h:
##########
@@ -52,19 +52,33 @@ class ICEBERG_EXPORT Schema : public StructType {
/// \brief Special value to select all columns from manifest files.
static constexpr std::string_view kAllColumns = "*";
+ /// \brief An empty schema instance.
+ static const std::shared_ptr<Schema> kEmptySchema;
+
explicit Schema(std::vector<SchemaField> fields,
Review Comment:
I think eventually we need to make it a private constructor.
##########
src/iceberg/schema.h:
##########
@@ -52,19 +52,33 @@ class ICEBERG_EXPORT Schema : public StructType {
/// \brief Special value to select all columns from manifest files.
static constexpr std::string_view kAllColumns = "*";
+ /// \brief An empty schema instance.
+ static const std::shared_ptr<Schema> kEmptySchema;
+
explicit Schema(std::vector<SchemaField> fields,
- std::optional<int32_t> schema_id = std::nullopt,
- std::vector<int32_t> identifier_field_ids = {});
+ std::optional<int32_t> schema_id = std::nullopt);
+
+ /// \brief Create a schema.
+ ///
+ /// \param fields The fields that make up the schema.
+ /// \param schema_id The unique identifier for this schema (default:
+ /// kInitialSchemaId). \param identifier_field_ids Field IDs that uniquely
identify
Review Comment:
The alignment is a little bit weird.
--
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]