Skip to content

Expr::is_volatile ignores the volatility of aggregate, window and higher-order functions #25504

Description

@neilconway

Describe the bug

Expr::is_volatile_node only checks Expr::ScalarFunction. AggregateUDF, WindowUDF and HigherOrderUDF declare a volatility too, but Expr::is_volatile never sees it, so optimizer rules that rely on it (CSE, filter pushdown, the simplifier, …) treat volatile user-defined functions of those kinds as deterministic. The physical layer already checks HOF volatility in HigherOrderFunctionExpr::is_volatile_node; the logical Expr is the outlier.

To Reproduce

No response

Expected behavior

No response

Additional context

All built-in functions in these categories are Immutable, so only user-defined functions are affected.

Activity

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