Add support for bucket expression to table scans

Open
#3,839 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
55/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
python
Domain
databases

Research direction

Start at the table.scan and scan.to_arrow entry points described in the issue, then trace the existing time-range expression handling used for Arrow partition pruning. Check how partition specs and row filters are applied; done means bucket expressions such as bucket16 can prune files when possible and fall back to row filtering when they cannot.

Written by the indexing model from the issue text.

Description

Feature Request / Improvement

For time partitioning, we can express time range expressions and they lead to partition pruning when planning an Arrow scan:

 scan = table.scan(
      row_filter=And(
          GreaterThanOrEqual("event_ts", start),
          LessThan("event_ts", end),
      )
  )

  arrow_table = scan.to_arrow()

It would be useful to be able to filter by other hidden partitioning transforms, such as buckets -- e.g. filtering on bucket[16](user_id) in {0, 1, 2, 3}, and getting partition pruning whenever possible based on the underlying table partitioning specs (falling back to filtering rows when files cannot be pruned).

Dominant language
Python
Stars
1.1k
Forks
589
Avg merge
2d 4h
Merged PRs (30d)
72

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from apache/iceberg-python

All issues in apache/iceberg-python

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.