Skip to content

Optimize how table partitions are pruned #1187

@rdettai

Description

@rdettai

Is your feature request related to a problem or challenge? Please describe what you are trying to do.
The ability to read partitioned tables is added the the ListingTable in #1141. In that implementation the table lists all the files before applying the partition pruning. This will be very slow for large tables.

Describe the solution you'd like
Instead of calling collect() on the stream of all files:

  • if a filter exists on the first level of partitions, first call the list_dir() feature of the object store to get the first level of partition and apply the filter on it
  • if the filter above was applied and was "selective enough", only list the files in the resulting folders for further pruning
  • otherwise use list_file on the entire table but evaluate the pruning progressively to stop listing as soon as limit is reached.

Describe alternatives you've considered
The current implementation works well on reasonably sized tables (few thousand files), but will fall short on huge tables (e.g. 100k file).

Additional context
The function where the magic happens:

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions