zhjwpku commented on code in PR #810:
URL: https://github.com/apache/iceberg-cpp/pull/810#discussion_r3524427803
##########
src/iceberg/schema_field.cc:
##########
@@ -124,6 +126,18 @@ Status ValidateDefault(const SchemaField& field, const
Literal& value,
return InvalidSchema("{} of field {} has type {} but expected {}", kind,
field.name(),
*value.type(), *field.type());
}
+ // A non-finite float/double default cannot be represented in JSON: the
serializer emits
+ // it as `null`, which reads back as an absent default. Reject it so the
default is not
+ // silently lost when the metadata round-trips.
+ const auto& literal_value = value.value();
+ const bool non_finite = (std::holds_alternative<float>(literal_value) &&
Review Comment:
You mentioned `NaN` in the PR description but doesn't seem to handle that,
is that intentional?
--
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]