rdblue commented on code in PR #6775:
URL: https://github.com/apache/iceberg/pull/6775#discussion_r1199488384
##########
python/tests/io/test_pyarrow.py:
##########
@@ -1186,6 +1194,63 @@ def
test_projection_filter_on_unknown_field(schema_int_str: Schema, file_int_str
assert "Could not find field with name unknown_field, case_sensitive=True"
in str(exc_info.value)
[email protected]
+def deletes_file(tmp_path: str, example_task: FileScanTask) -> str:
+ path = example_task.file.file_path
+ table = pa.table({"file_path": [path, path, path], "pos": [1, 3, 5]})
+
+ deletes_file_path = f"{tmp_path}/deletes.parquet"
+ pq.write_table(table, deletes_file_path)
+
+ return deletes_file_path
+
+
+def test_read_deletes(deletes_file: str, example_task: FileScanTask) -> None:
+ deletes = _read_deletes(LocalFileSystem(),
DataFile(file_path=deletes_file, file_format=FileFormat.PARQUET))
+ assert set(deletes.keys()) == {example_task.file.file_path}
+ assert list(deletes.values())[0] == pa.chunked_array([[1, 3, 5]])
+
+
+def test_delete(deletes_file: str, example_task: FileScanTask,
table_schema_simple: Schema) -> None:
Review Comment:
I'd like to see a lot more tests, especially with a combination of delete
files and filters.
--
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]