rahulsmahadev commented on code in PR #4591:
URL: https://github.com/apache/iceberg-python/pull/4591#discussion_r4790994769
##########
tests/io/test_pyarrow.py:
##########
@@ -2166,6 +2166,26 @@ def test_read_deletes(deletes_file: str, request:
pytest.FixtureRequest) -> None
assert list(deletes.values())[0] == pa.chunked_array([[1, 3, 5]])
[email protected]("file_format", [FileFormat.PARQUET, FileFormat.ORC])
+def test_read_deletes_groups_positions_by_file_path(tmp_path: Path,
file_format: FileFormat) -> None:
+ positions_per_file = {f"s3://bucket/data/file-{index}.parquet": [index,
index + 1, index + 2] for index in range(100)}
+ table = pa.table(
+ {
+ "file_path": [path for path, positions in
positions_per_file.items() for _ in positions],
+ "pos": [position for positions in positions_per_file.values() for
position in positions],
+ }
+ )
+ delete_file_path = tmp_path / ("deletes.parquet" if file_format ==
FileFormat.PARQUET else "deletes.orc")
+ if file_format == FileFormat.PARQUET:
+ pq.write_table(table, delete_file_path)
Review Comment:
This writes a single row group, so the test still passes without
`unify_dictionaries()`, which a file with several row groups needs
(`ArrowNotImplementedError: Unifying differing dictionaries`). Several row
groups would cover it:
```suggestion
pq.write_table(table, delete_file_path, row_group_size=3)
```
--
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]