gty404 commented on code in PR #1052:
URL: https://github.com/apache/iceberg-cpp/pull/1052#discussion_r4355507766
##########
src/iceberg/schema_field.cc:
##########
@@ -243,7 +243,7 @@ bool DefaultEquals(const std::shared_ptr<const Literal>&
lhs,
bool SchemaField::Equals(const SchemaField& other) const {
return field_id_ == other.field_id_ && name_ == other.name_ && *type_ ==
*other.type_ &&
- optional_ == other.optional_ &&
+ optional_ == other.optional_ && doc_ == other.doc_ &&
Review Comment:
Thanks for pointing this out. The current C++ API already represents both an
absent doc and an explicitly empty doc as an empty std::string. Deserialization
defaults a missing doc to an empty string, and serialization omits empty docs,
so that distinction is lost before equality is checked. This PR preserves that
existing behavior while making changes to the doc string participate in schema
equality. Matching Java’s null-versus-empty semantics would require a separate
change to the doc representation, API, and serialization.
--
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]