#29624·polars

Oversized dict page error

Author: ben-freistCreated Sep 29, 2026Updated Sep 29, 2026
Labelsbugpythonneeds triage

Checks

  • I have checked that this issue has not already been reported.
  • I have confirmed this bug exists on the latest version of Polars.

Reproducible example

python
import sys
import tempfile

import polars as pl

# 10_000 rows, every 10th non-null: 1_000 distinct ~2.2 MiB strings (~2.2 GiB) in one row group.
size = int(2.2 * 2**20)
big = "x" * (size + 1_000)
values = [big[: size + i // 10] if i % 10 == 0 else None for i in range(10_000)]
df = pl.DataFrame({"s": values}, schema={"s": pl.String})
del big, values

print(f"polars {pl.__version__}")
with tempfile.TemporaryDirectory() as d:
    if sys.argv[1:] == ["pyarrow"]:
        import pyarrow.parquet as pq

        pq.write_table(df.to_arrow(), f"{d}/out.parquet", row_group_size=10_000)
        print("pyarrow: ok")
    else:
        df.lazy().sink_parquet(f"{d}/out.parquet")
        print("polars: ok")

Log output

bash
_init_credential_provider_builder(): credential_provider_init = None
async thread count: 16
blocking thread count: 512
polars-stream: updating graph state
updating io-sink[single-file[parquet]], before: [Blocked] []
updating io-sink[single-file[parquet]], after: [Ready] [] (took 70ns)
updating in-memory-source, before: [] [Ready]
updating in-memory-source, after: [] [Ready] (took 2.856µs)
updating io-sink[single-file[parquet]], before: [Ready] []
updating io-sink[single-file[parquet]], after: [Ready] [] (took 60ns)
polars-stream: running io-sink[single-file[parquet]] in subgraph
polars-stream: running in-memory-source in subgraph
total memory: 30.053 GiB (32269598720 bytes)
io-sink[single-file[parquet]]: start_single_file_sink_pipeline: file_writer_starter: parquet, target_sink_morsel_size: TargetSinkMorselSize { target_num_rows: 122880, target_num_bytes: 18446744073709551615, target_num_bytes_min_rows: 16384, target_num_rows_mode: Approximate }, inflight_morsel_limit: 20, upload_chunk_size: Some(33554432), upload_concurrency: 30, io_metrics: false, build_sinked_path_info_list: false
polars-stream: done running graph phase
polars-stream: updating graph state
updating io-sink[single-file[parquet]], before: [Ready] []
updating io-sink[single-file[parquet]], after: [Ready] [] (took 80ns)
updating in-memory-source, before: [] [Ready]
updating in-memory-source, after: [] [Done] (took 200ns)
updating io-sink[single-file[parquet]], before: [Done] []
io-sink[single-file[parquet]]: Join on task_handle (recv PortState::Done)
polars 1.44.2
Traceback (most recent call last):
  File "repro_dict_page.py", line 26, in <module>
    df.lazy().sink_parquet(f"{d}/out.parquet")
  File ".venv/lib/python3.12/site-packages/polars/lazyframe/frame.py", line 3021, in sink_parquet
    return _select_engine(engine).sink_parquet(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File ".venv/lib/python3.12/site-packages/polars/lazyframe/engine.py", line 616, in sink_parquet
    return self._finish_sink(ldf_py, lazy=lazy, optimizations=optimizations)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File ".venv/lib/python3.12/site-packages/polars/lazyframe/engine.py", line 522, in _finish_sink
    self.collect(lf, optimizations=optimizations)
  File ".venv/lib/python3.12/site-packages/polars/lazyframe/engine.py", line 443, in collect
    return wrap_df(ldf.collect(self.name, callback))
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
polars.exceptions.ComputeError: parquet: File out of specification: A page can only contain i32::MAX uncompressed bytes. This one contains 2307370500

Issue description

This sometimes triggers on sparse columns that contain long strings. To get the script for reproducing it, I've first singled out a single file from my actual workload that triggers this and then asked claude (opus 5.5) to reproduce it with synthetic data.

Expected behavior

No error, a file should be created.

Installed versions

--------Version info---------
Polars:              1.44.2
Index type:          UInt32
Platform:            Linux-7.0.0-28-generic-x86_64-with-glibc2.39
Python:              3.12.9 (main, Mar 17 2025, 21:01:58) [Clang 20.1.0 ]
Runtime:             rt32

----Optional dependencies----
Azure CLI            <not installed>
adbc_driver_manager  <not installed>
altair               <not installed>
azure.identity       <not installed>
boto3                1.43.56
cloudpickle          <not installed>
connectorx           <not installed>
deltalake            <not installed>
fastexcel            <not installed>
fsspec               2026.7.0
gevent               <not installed>
google.auth          2.56.3
great_tables         <not installed>
matplotlib           <not installed>
numpy                2.5.2
openpyxl             <not installed>
pandas               <not installed>
polars_cloud         <not installed>
pyarrow              25.0.1
pydantic             2.13.4
pyiceberg            <not installed>
sqlalchemy           <not installed>
torch                2.13.0+cu130
xlsx2csv             <not installed>
xlsxwriter           <not installed>