You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Ilya Soin (Jira)" <ji...@apache.org> on 2026/09/07 14:59:00 UTC

[jira] [Updated] (FLINK-40399) Separate the SavepointKeyFilter runtime contract from push-down planning

     [ https://issues.apache.org/jira/browse/FLINK-40399?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ilya Soin updated FLINK-40399:
------------------------------
    Description: 
_SavepointKeyFilter_ currently carries two unrelated responsibilities: the runtime contract required by savepoint scans ({_}test{_}, {_}getExactKeys{_}) and planning algebra used only while
  combining predicates during filter push-down ({_}isEmpty{_}, {_}getLowerBound{_}, {_}getUpperBound{_}, {_}intersect{_}, {_}filterKeys{_}, {_}empty{_}, and {_}BoundInfo{_}). The latter is exposed through the public
  _@Experimental_ API despite being irrelevant to DataStream API implementations.

  This task separates those responsibilities. _org.apache.flink.state.api.filter.SavepointKeyFilter_ retains its runtime contract and
  _exact/range_ factories. Planning-only range bounds and predicate-combination logic are kept in a private _KeyFilterPlan_ inside {_}SavepointFilterTranslator{_}, which tracks predicate
  state during translation and constructs the resulting existing runtime filter implementation afterward.

  The planning-only methods, {_}BoundInfo{_}, and _EmptyKeyFilter_ are removed.

  The task also adds coverage for previously untested runtime filters and push-down paths—most importantly, ensuring predicates that cannot be pushed down are returned in
  _remaining()_ and therefore still evaluated by the runtime.

  was:
_SavepointKeyFilter_ currently carries two unrelated responsibilities: the contract the savepoint scan needs ({_}test{_}, {_}getExactKeys{_}) and the algebra used only while combining predicates during filter push-down ({_}isEmpty, getLowerBound, getUpperBound, intersect, filterKeys, empty,{_} plus {_}BoundInfo{_}). The second group is public and _@Experimental_ despite being unusable outside push-down translation.

This task splits the two: _org.apache.flink.state.api.filter.SavepointKeyFilter_ keeps only the runtime contract, and the planning algebra moves to an _@Internal SavepointKeyFilterPlan_ in {_}org.apache.flink.state.table.filter{_}, alongside the connector that is its only user. No behaviour change.
 

Also adds test coverage for existing push-down paths that had none — most importantly that predicates which cannot be pushed are returned in _remaining()_ so the runtime still evaluates them.


> Separate the SavepointKeyFilter runtime contract from push-down planning
> ------------------------------------------------------------------------
>
>                 Key: FLINK-40399
>                 URL: https://issues.apache.org/jira/browse/FLINK-40399
>             Project: Flink
>          Issue Type: Improvement
>          Components: API / State Processor
>    Affects Versions: 2.4.0
>            Reporter: Ilya Soin
>            Priority: Minor
>              Labels: pull-request-available
>
> _SavepointKeyFilter_ currently carries two unrelated responsibilities: the runtime contract required by savepoint scans ({_}test{_}, {_}getExactKeys{_}) and planning algebra used only while
>   combining predicates during filter push-down ({_}isEmpty{_}, {_}getLowerBound{_}, {_}getUpperBound{_}, {_}intersect{_}, {_}filterKeys{_}, {_}empty{_}, and {_}BoundInfo{_}). The latter is exposed through the public
>   _@Experimental_ API despite being irrelevant to DataStream API implementations.
>   This task separates those responsibilities. _org.apache.flink.state.api.filter.SavepointKeyFilter_ retains its runtime contract and
>   _exact/range_ factories. Planning-only range bounds and predicate-combination logic are kept in a private _KeyFilterPlan_ inside {_}SavepointFilterTranslator{_}, which tracks predicate
>   state during translation and constructs the resulting existing runtime filter implementation afterward.
>   The planning-only methods, {_}BoundInfo{_}, and _EmptyKeyFilter_ are removed.
>   The task also adds coverage for previously untested runtime filters and push-down paths—most importantly, ensuring predicates that cannot be pushed down are returned in
>   _remaining()_ and therefore still evaluated by the runtime.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)