mbutrovich commented on code in PR #2695:
URL: https://github.com/apache/iceberg-rust/pull/2695#discussion_r3500996469
##########
crates/iceberg/src/arrow/reader/pipeline.rs:
##########
@@ -248,6 +250,16 @@ impl FileScanTaskReader {
record_batch_transformer_builder.with_constant(RESERVED_FIELD_ID_FILE,
file_datum);
}
+ if task
+ .project_field_ids()
+ .contains(&RESERVED_FIELD_ID_SPEC_ID)
+ && let Some(partition_spec) = &task.partition_spec
Review Comment:
+1. If the invariant is that `task.partition_spec` is always present
(spec_id = 0 even for unpartitioned tables), then gating the column on `let
Some(partition_spec)` means a projected `_spec_id` can silently produce no
column when that invariant is ever violated, which would be a confusing 'column
vanished' bug rather than a clean error. Adding `_spec_id` to the constant map
whenever it's projected (per @advancedxy) is the safer contract. Worth a test
on an unpartitioned table to lock in spec_id = 0.
--
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]