Skip to content

[Bug]: Function-scan filter pushdown can silently drop non-pushable predicates #25593

Closed

Description

@XuPeng-SH

Is there an existing issue for the same bug?

  • I have checked the existing issues.

Branch Name

main

Commit ID

7821d21

Other Environment Information

  • Hardware parameters: N/A
  • OS type: Linux
  • Others: SQL optimizer filter pushdown through FUNCTION_SCAN.

Actual Behavior

pushdownFilters forwarded filters that did not belong to a FUNCTION_SCAN node to its child, but discarded the child’s returned cantPushdown filters. A mixed-tag predicate could therefore disappear from the plan rather than being kept above the function scan.

This is a correctness issue: a query can return rows that should have been filtered out.

Expected Behavior

Every filter rejected by a FUNCTION_SCAN child must be returned to the parent pushdown caller and materialized as a normal filter at the correct plan level. A function scan with no child must also return, rather than discard, incoming non-self filters.

Steps to Reproduce

  1. Build a plan with a FUNCTION_SCAN above a table scan.
  2. Use a predicate that references both the function-scan binding tag and the child binding tag.
  3. Run filter pushdown before the fix.
  4. Observe that the predicate is neither attached to the child nor returned as cantPushdown.

Additional Information

The regression test constructs a mixed-tag equality predicate and verifies that it is returned intact, with neither scan receiving an invalid partial pushdown.

Activity

  1. added this to the MO-202607 milestone on Jul 11, 2026
  2. self-assigned this
    on Jul 11, 2026
  3. added
    kind/bug
    severity/s0
    and removed on Jul 11, 2026
  4. added theissue type on Jul 11, 2026
  5. added a commit that references this issue on Jul 12, 2026
    de64386
  6. XuPeng-SH commented on Jul 12, 2026

    @XuPeng-SH
    ContributorAuthor
  7. Ariznawlll commented on Jul 13, 2026

    @Ariznawlll
    Collaborator

    已在最新 main@2865ed6cc8a39727b8b274bb52b88fe441d0b30c 验证通过。

    • 对应修复:de6438665 / fix: strengthen filter pushdown and PK pruning #25596。
    • FUNCTION_SCAN 现在收集 child 返回的 cantPushdown;无 child 时也会将非 self filters 返回给 parent,不再静默丢弃。
    • TestFunctionScanDoesNotDropMixedTagFilter 使用 -race -count=5 通过,mixed-tag predicate 被完整保留,未错误附着到任一扫描节点。

    正确性问题未再复现,修复有效。

  8. added 3 commits that reference this issue on Sep 17, 2026
    69cf9ab
    00f3b8c
    59220c3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

kind/bugseverity/s0

Type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions