Skip to content

[OPL/OTAP query-engine functions] starts_with / ends_with #2819

@albertlockett

Description

@albertlockett

Add support for checking if some string has a suffix/prefix in OPL / OTAP query-engine.

logs | where starts_with(attributes["x"], "prefix")
logs | where ends_with(attributes["x"], "suffix")

For general implementation instructions see #2818

The UDFs we should use are:
https://datafusion.apache.org/user-guide/sql/scalar_functions.html#starts-with
https://datafusion.apache.org/user-guide/sql/scalar_functions.html#ends-with

This should be parsed into an InvokeFunctionExpr as no special AST expression specifically exists for this capability.

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions