Skip to content

[BUG] Grok/Parse/Patterns parse a null field should return an empty string with Calcite #4380

@LantaoJin

Description

@LantaoJin

What is the bug?
Grok parse a null field will return an empty string in v2, ref. but it returns null in v3.

How can one reproduce the bug?

source=accounts | grok email '.+@%{HOSTNAME:host}' | fields email, host ;
    fetched rows / total rows = 4/4
    +-----------------------+------------+
    | email                 | host       |
    |-----------------------+------------|
    | amberduke@pyrami.com  | pyrami.com |
    | hattiebond@netagy.com | netagy.com |
    | null                  | null       |
    | daleadams@boink.com   | boink.com  |
    +-----------------------+------------+
source=accounts | parse email '.+@(?<host>.+)' | fields email, host ;
    fetched rows / total rows = 4/4
    +-----------------------+------------+
    | email                 | host       |
    |-----------------------+------------|
    | amberduke@pyrami.com  | pyrami.com |
    | hattiebond@netagy.com | netagy.com |
    | null                  | null       |
    | daleadams@boink.com   | boink.com  |
    +-----------------------+------------+
source=accounts | patterns email method=simple_pattern | fields email, patterns_field ;
    fetched rows / total rows = 4/4
    +-----------------------+----------------+
    | email                 | patterns_field |
    |-----------------------+----------------|
    | amberduke@pyrami.com  | @.             |
    | hattiebond@netagy.com | @.             |
    | null                  | null           |
    | daleadams@boink.com   | @.             |
    +-----------------------+----------------+

Metadata

Metadata

Assignees

No one assigned

    Labels

    PPLPiped processing languagebugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions