Skip to content

Requirements for scalar UDF preimage #21955

Description

@linhr

ScalarUDFImpl::preimage allows defining "preimage" (range of input values) for function outputs, which can be used to rewrite binary comparison expressions.

The rewrite rules for equality (=) or inequality (!=) seem intuitive. But f(x) <= c would also be rewritten to x < u where u is the (exclusive) upper bound. (Here is the code.) I'm not sure if this holds in general. Does this assume that the function must be monotonically non-decreasing?

I was trying to see if the documentation mentions monotonicity for scalar UDFs but I couldn't find it. Let me know if I misunderstood anything!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions