Skip to content

R2RML over Iceberg: a triples map can't filter its table's rows (rr:sqlQuery is refused, and there's no alternative) #2242

Closed

Description

@aaj3f

Problem

An R2RML mapping over Iceberg tables can only name a whole table: rr:sqlQuery logical tables are refused for Iceberg sources ("rr:sqlQuery logical tables are only supported by SQL graph sources", fluree-db-api/src/graph_source/r2rml.rs:268). So a mapping can't select a subset of rows.

The case where this hurts most is a slowly-changing dimension: a table that keeps every historical version of an entity, with a flag such as is_current = 1 on the live row. A mapping that wants "the current customer" has no way to say so. It either maps every version, and gets one copy of each attribute per version (see #2238), or it needs someone to materialize a separate current-rows table upstream just for Fluree. The same goes for soft-deleted rows (is_deleted = 0) and tenant or region slices.

Expected

Some way for a triples map over an Iceberg table to carry a row filter that is pushed into the scan like any other predicate, so it prunes files and row groups. Options, roughly from smallest to largest:

  1. A Fluree extension on the logical table, e.g. rr:logicalTable [ rr:tableName "customers_history" ; fr:filter [ fr:column "is_current" ; fr:equals 1 ] ], limited to the comparison operators the scan already pushes.
  2. A restricted rr:sqlQuery subset for Iceberg (SELECT <cols> FROM <table> WHERE <conjunction of simple comparisons>), parsed into the existing pushdown predicates and refused otherwise.
  3. Full R2RML views (only realistic through the SQL lane).

Option 1 or 2 covers the common cases without needing a SQL engine in the Iceberg path.

Where (at ca682e2b8)

  • fluree-db-api/src/graph_source/r2rml.rs:268 and :3829: the refusal.
  • fluree-db-r2rml/src/mapping/triples_map.rs:331-383: LogicalTable::SqlQuery already exists in the mapping model.
  • The scan predicate types the filter would lower to are the ones the object-position pushdown already uses (fluree-db-query/src/r2rml/rewrite.rs).

Activity

  1. added
    enhancement
    P3
    area:iceberg
    on Nov 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

    P3area:icebergenhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions