Skip to content

[Bug] PyPaimon rejects system-table predicates with more than 256 leaves. #11626

Backlog

Description

@fengruotj

Search before asking

  • I searched in the issues and found nothing similar.

Paimon version

Apache Paimon 2.2-SNAPSHOT

Compute Engine

PyPaimon Python reader, Python 3.13.2, PyArrow 22.0.0.

Minimal reproduce step

Create a table with file.format=parquet and read its $options system table. Only the first equality condition matches. Going from 256 to 257 conditions adds one more missing key.

from tempfile import TemporaryDirectory

import pyarrow as pa
from pypaimon import CatalogFactory, Schema

with TemporaryDirectory() as warehouse:
    catalog = CatalogFactory.create({"warehouse": warehouse})
    catalog.create_database("db", False)
    schema = Schema.from_pyarrow_schema(
        pa.schema([("id", pa.int32())]),
        options={"file.format": "parquet"},
    )
    catalog.create_table("db.strings", schema, False)
    table = catalog.get_table("db.strings$options")

    for count in (256, 257):
        read = table.new_read_builder()
        pb = read.new_predicate_builder()
        keys = ["file.format"] + [f"missing-{i}" for i in range(1, count)]
        read.with_filter(pb.or_predicates([pb.equal("key", k) for k in keys]))
        splits = read.new_scan().plan().splits()
        try:
            print(count, read.new_read().to_arrow(splits).column("key").to_pylist())
        except NotImplementedError as error:
            print(count, f"NotImplementedError: {error}")

Actual output on 8b641ae1f3

256 ['file.format']
257 NotImplementedError: This predicate is not supported on system tables

What doesn't meet your expectations?

Both queries should return ['file.format']. Adding an OR condition for a key absent from the table leaves the set of matching rows unchanged.

Anything else?

PyPaimon limits Arrow filter expressions to 256 leaves. When an equality predicate tree exceeds this limit, the system-table reader raises NotImplementedError in to_arrow(). It could keep the Arrow limit and evaluate the predicate with its existing row filter.

Are you willing to submit a PR?

  • I'm willing to submit a PR!

Activity

  1. added
    bug
    on Dec 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions