feat: Push column projection and time-range filters down to Iceberg scans in the DuckDB and Spark offline stores
维护者通常 1 天内回复
@Wali05 已经在做这个了。
开始于 2026年11月24日。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 35/100
- Issue 类型
- 功能
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- python, spark
调研方向
Start with _read_iceberg_catalog_source in the DuckDB offline store and _register_iceberg_source_as_temp_view in the Spark store, then the data_source_reader helpers that pull_latest_from_table_or_query_ibis, pull_all_from_table_or_query_ibis and get_historical_features_ibis share. Done means the PyIceberg scan receives selected_fields and row_filter where the hints allow, and historical-feature results match an unpruned read in tests against a real SqlCatalog. The issue proposes a DataSourceReadHints design that touches several shared readers, so check with maintainers before starting.
由索引模型根据 Issue 内容生成。
描述
Is your feature request related to a problem? Please describe.
Follow-up to #6499 / #7005 (Polaris support, merged in #7006). Reads from an IcebergSource are always a full-table scan:
- DuckDB offline store:
_read_iceberg_catalog_sourcedoestable.scan().to_arrow()and wraps the result inibis.memtable(...). The column selection and time-range filters thatpull_latest_from_table_or_query_ibis,pull_all_from_table_or_query_ibisandget_historical_features_ibisapply afterwards are evaluated by DuckDB on the already-materialized table, so they never reach the Iceberg scan. - Spark offline store:
_register_iceberg_source_as_temp_viewdoesscan().to_arrow()andcreateDataFrame(...), so every column of the table is loaded into the driver regardless of what the feature view uses.
For wide or large tables this means reading all columns and all partitions/files just to use a few columns in a bounded time window, which also defeats Iceberg's column projection and partition/file pruning.
The data needed to avoid this is already known where the read happens, but the reader contract is data_source_reader(data_source, repo_path) -> Table, which has no way to carry it:
pull_latest_*/pull_all_*: the exact columns (join_keys + features + timestamp fields) andstart_date/end_date.get_historical_features_ibis.read_fv: the join keys, requested feature columns and timestamp columns of each feature view, and the entity dataframe's event-timestamp range (a feature row can only matter iftimestamp <= max(entity ts), and, with a TTL,timestamp >= min(entity ts) - ttl).
Describe the solution you'd like
- Add a small
DataSourceReadHintsdataclass (columns,timestamp_field,start,end) and an optional hints-aware reader alongside the existingdata_source_readerin the ibis helpers. Existing readers (MSSQL, Oracle, file-based) keep working unchanged; offline stores that supply the hints-aware reader get pushdown. - DuckDB: pass the hints to
_read_iceberg_catalog_source, which calls PyIcebergscan(selected_fields=..., row_filter=...).- Translate Feast-side column names back to source names through
field_mapping, and only select columns that exist in the table schema. - Only build a time filter when the timestamp column is an Iceberg
timestamp/timestamptz(using the matching tz-aware / naive UTC literal). Otherwise skip it. - The filter is a pure optimization: the existing ibis filters are still applied afterwards, so results must be identical with and without pushdown.
- Translate Feast-side column names back to source names through
- Spark: prune the registered temp view to the columns the feature view needs (and apply the time bounds where the entity range is available).
- Unit tests against a real PyIceberg
SqlCatalog(not only mocks) that assert both the scan arguments and that results match the unpruned read; docs note.
Describe alternatives you've considered
- Predicate pushdown on entity keys (
join_key IN (...)): potentially large win for small entity dataframes, but riskier (large IN lists, composite keys, type coercion). Left out of the first iteration. - Lazy scans via DuckDB's Iceberg extension instead of Arrow materialization: bigger change to how the offline store reads, and would not cover Spark.
- Changing the
data_source_readersignature for all readers: breaking for the MSSQL/Oracle stores that share these helpers.
Additional context
Related: #6499, #7005, #7006. I plan to open a PR for this.
- 主要语言
- Python
- 星标
- 7.4k
- 派生
- 1.5k
- 平均合并
- 2 天 6 小时
- 30 天内合并 PR
- 107
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
feast-dev/feast 的其他 Issue
-
ConflictingFeatureViewNames raised across projects when a LabelView shares a name with another feature view type可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭
难度 2/5 1-3 小时 新手友好度 85/100
维护者通常 1 天内回复
-
BigQuery data quality monitoring fails: PRIMARY KEY placed outside the column list in monitoring table DDL可能已有人在做 @liron-velocity 于 51 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
get_online_features silently drops a join key value when it shares a name with an OnDemandFeatureView's RequestSource field可能已有人在做 @OHMFOHS 于 99 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
kind/bug priority/p2
难度 1/5 1 小时以内 新手友好度 90/100
feast-dev/feast#6778 · 1 条评论 ·
维护者通常 1 天内回复
相似的 Issue
-
docs(contributing): the two things that silently block a PR可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭available documentation good first issue
难度 1/5 1-3 小时 新手友好度 95/100
Nixitov/Riptide-Native#944 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 88/100
JTHCode/secretguard#24 ·
维护者通常 1 天内回复
-
area: middleware documentation good first issue
难度 2/5 1-3 小时 新手友好度 88/100
-
enhancement good first issue
难度 2/5 1-3 小时 新手友好度 88/100
维护者通常 1 天内回复
-
good first issue
难度 1/5 1 小时以内 新手友好度 95/100
omarelshamy25x/shamy-hijri#63 ·
维护者通常 1 天内回复