Skip to content

feat: plan-time SQL expression simplifying #19312

@theirix

Description

@theirix

Is your feature request related to a problem or challenge?

Some SQL constructs require parsing numeric expressions at plan-time, so planners must use a literal. For example, SELECT * FROM TABLE SAMPLE (10 + 50 * 2), window functions. In #17843, there is a custom function eval_numeric_expr to make a tree traversal to resolve a literal. It would be nice to have a reusable function in core.

Describe the solution you'd like

A generic reusable function module for parsing and simplifying an SQL expression to a literal of a given type.

Describe alternatives you've considered

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions