Skip to content

Commit

Permalink
Fix file size determination for data generation script (#1497)
Browse files Browse the repository at this point in the history
  • Loading branch information
phofl authored Mar 28, 2024
1 parent c400d36 commit f9eda14
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/tpch/generate_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,8 +273,8 @@ def rows_approx_mb(con, table_name, partition_size: str, compression: Compressio
tmp = pathlib.Path(tmpdir) / "tmp.parquet"
stmt = f"select * from {table_name} limit {sample_size}"
df = con.sql(stmt).arrow()
write_table(table_name, df, tmp, compression)
mb = tmp.stat().st_size
file = write_table(table_name, df, tmp, compression)
mb = pathlib.Path(file).stat().st_size
return int(
(len(table) * ((len(table) / sample_size) * partition_size)) / mb
) or len(table)
Expand Down

0 comments on commit f9eda14

Please sign in to comment.