Fokko commented on code in PR #4370:
URL: https://github.com/apache/iceberg-python/pull/4370#discussion_r4572197200


##########
pyiceberg/table/__init__.py:
##########
@@ -2506,6 +2506,26 @@ def _to_arrow_batch_reader_via_file_scan_tasks(
     return pa.RecordBatchReader.from_batches(target_schema, 
batches).cast(target_schema)
 
 
+def _partition_with_literal_values(partition_type: StructType) -> 
Callable[[Record], Record]:

Review Comment:
   I don't think we should patch the `Record` here. It feels like we're working 
around the actual issue: partition values are `uuid.UUID` while `UUIDLiteral` 
holds `bytes`. Converting at two call sites in the planner means every other 
place that evaluates a partition `Record` still has to know about this. For 
example, the projected identity values in `visitors.py` build 
`Record(field_value)` from the partition value and run into the same mismatch. 
It also allocates a new `Record` for every data file on uuid specs, and adds 
another spec keyed cache to `plan_files`. If we make both representations agree 
(see my comment above), this helper can go away.
   



-- 
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]

Reply via email to