laskoviymishka commented on code in PR #2845:
URL: https://github.com/apache/iceberg-rust/pull/2845#discussion_r3626269535
##########
crates/iceberg/src/arrow/record_batch_transformer.rs:
##########
@@ -59,11 +59,11 @@ fn constants_map(
for (pos, field) in partition_spec.fields().iter().enumerate() {
// Only identity transforms should use constant values from partition
metadata
if matches!(field.transform, Transform::Identity) {
- // Get the field from schema to extract its type
- let iceberg_field =
schema.field_by_id(field.source_id).ok_or(Error::new(
- ErrorKind::Unexpected,
- format!("Field {} not found in schema", field.source_id),
- ))?;
+ // The source column may have been dropped from the schema after
the spec was
+ // created. It cannot be projected in that case, so no constant is
needed.
+ let Some(iceberg_field) = schema.field_by_id(field.source_id) else
{
Review Comment:
ah you're right, I missed #2695, the spec is threaded through now, so this
is a live-path fix, not the forward-looking guard, thanks for the pointer.
test's covered in #2869.
--
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]