ZENOTME commented on code in PR #795:
URL: https://github.com/apache/iceberg-rust/pull/795#discussion_r1899896614
##########
crates/iceberg/src/spec/values.rs:
##########
@@ -2728,22 +2730,24 @@ mod _serde {
optional: _,
}) => match ty {
Type::Struct(struct_ty) => {
- let iters: Vec<Option<Literal>> = required
- .into_iter()
- .map(|(field_name, value)| {
- let field = struct_ty
- .field_by_name(field_name.as_str())
- .ok_or_else(|| {
- invalid_err_with_reason(
- "record",
- &format!("field {} is not exist",
&field_name),
- )
- })?;
- let value = value.try_into(&field.field_type)?;
- Ok(value)
+ let mut value_map: HashMap<String, RawLiteralEnum> =
Review Comment:
Because when deserilaize, None will be convert to RawLiteralEnum::Null. So
there is no need for optional here. And actually, when deserialize, we don't
know the schema, so that we don't know which value is optional and which is
required, we just know which value is valid and which is none.
--
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]