From 723f91f0c50aff89d3f0e0ad464500d8d4d065be Mon Sep 17 00:00:00 2001 From: Ion Koutsouris <15728914+ion-elgreco@users.noreply.github.com> Date: Tue, 6 Feb 2024 19:17:11 +0100 Subject: [PATCH] add test --- python/tests/test_writer.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/python/tests/test_writer.py b/python/tests/test_writer.py index 9252dfdd41..e210f0d4a0 100644 --- a/python/tests/test_writer.py +++ b/python/tests/test_writer.py @@ -1251,3 +1251,24 @@ def test_with_deltalake_schema(tmp_path: pathlib.Path, sample_data: pa.Table): ) delta_table = DeltaTable(tmp_path) assert delta_table.schema().to_pyarrow() == sample_data.schema + + +def test_write_stats_empty_rowgroups_2169(tmp_path: pathlib.Path): + data = pa.table( + { + "data": pa.array(["B"] * 1024 * 33), + } + ) + write_deltalake( + tmp_path, + data, + max_rows_per_file=1024 * 32, + max_rows_per_group=1024 * 16, + min_rows_per_group=8 * 1024, + mode="overwrite", + ) + dt = DeltaTable(tmp_path) + assert ( + dt.to_pyarrow_dataset().to_table(filter=(pc.field("data") == "B")).shape[0] + == 33792 + )