Fokko commented on code in PR #31: URL: https://github.com/apache/iceberg-cpp/pull/31#discussion_r1939655258
########## src/iceberg/schema_field.cc: ########## @@ -0,0 +1,64 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +#include "iceberg/schema_field.h" + +#include <format> + +#include "iceberg/type.h" +#include "iceberg/util/formatter.h" + +namespace iceberg { + +SchemaField::SchemaField(int32_t field_id, std::string name, std::shared_ptr<Type> type, + bool optional) + : field_id_(field_id), + name_(std::move(name)), + type_(std::move(type)), + optional_(optional) {} Review Comment: It is because the spec serializes it as `required`: https://iceberg.apache.org/spec/#schemas This way it is more straightforward to serialize it using the library that we use (Pydantic). See the original issue: https://github.com/apache/iceberg/issues/4985. In PyIceberg we have a property called `optional` as well, so you can choose. -- 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: issues-unsubscr...@iceberg.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org For additional commands, e-mail: issues-h...@iceberg.apache.org