Skip to content

Incorrect results: leaf expression pushdown duplicates volatile expressions (random() evaluated twice) #24678

Closed

Description

@fornwall

Describe the bug

enable_leaf_expression_pushdown inlines a column's defining expression into each extracted get_field that references it, but performs no volatility check.

To Reproduce

Run this:

datafusion-cli -c "SELECT s, s['a'] AS field FROM (SELECT named_struct('a', random()) AS s FROM generate_series(1,3));"

Expected behavior

field equals s.a on every row.

Additional context

Setting enable_leaf_expression_pushdown = false avoids the bug (makes field equals s.a on every row).

Activity

  1. added theissue type on Aug 25, 2026
  2. fornwall commented on Aug 25, 2026

    @fornwall
    ContributorAuthor

    Seems to be fixed by #23691 (but I have not reviewed or tested that PR extensively, just found that when searching around for the issue).

  3. fornwall commented on Aug 25, 2026

    @fornwall
    ContributorAuthor

    Does not seem to be a regression, 53 and 54 have the same issue.

  4. added a commit that references this issue on Sep 3, 2026
    27e81e9
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

    bugSomething isn't working

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions