Skip to content

clp-s: EvaluateTimestampIndex pass doesn't handle matching against wildcards. #1096

@gibber9809

Description

@gibber9809

Bug

Currently, the EvaluateTimestampFilter class does not properly handle matching against pure wildcards.

E.g. if "ts" is the authoritative timestamp then ts: * will crash because EvaluateTimestampFilter attempts to convert * to an integer.

The code has the following comment before it static casts the literal to Integral:

// this is safe after type narrowing because all DateType literals are either
// Integral or a derived class of Integral

The issue is that after type narrowing the literal is either Integral OR it is a pure wildcard stored as a string literal.

We should be able to fix this issue by adding a special case to the evaluation logic to check whether the literal predicate is a pure wildcard before attempting to convert it to an integer.

CLP version

v0.4.0

Environment

ubuntu jammy docker container

Reproduction steps

  • Compress a log like {"ts": "123"} with --timestamp-key ts
  • Execute the search query 'ts: *'

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions