Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimize how table partitions are pruned #1187

Open
rdettai opened this issue Oct 28, 2021 · 0 comments
Open

Optimize how table partitions are pruned #1187

rdettai opened this issue Oct 28, 2021 · 0 comments
Labels
enhancement New feature or request

Comments

@rdettai
Copy link
Contributor

rdettai commented Oct 28, 2021

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:

@rdettai rdettai added the enhancement New feature or request label Oct 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant