Skip to content

[Bug] RowKind::FromShortString should be case-insensitive #14

@slfan1989

Description

@slfan1989

Search before asking

  • I searched in the issues and found nothing similar.

Paimon-cpp version

Java Paimon's RowKind.fromShortString normalizes the input with toUpperCase(), so both uppercase and lowercase short strings are accepted.

For example, in Java:

RowKind.fromShortString("+i")
RowKind.fromShortString("-u")
RowKind.fromShortString("+u")
RowKind.fromShortString("-d")

can be parsed successfully.

However, in paimon-cpp, RowKind::FromShortString currently only accepts exact uppercase strings:

RowKind::FromShortString("+I")
RowKind::FromShortString("-U")
RowKind::FromShortString("+U")
RowKind::FromShortString("-D")

Lowercase inputs such as "+i" or "-d" return an invalid status.

Minimal reproduce step

In paimon-cpp, RowKind::FromShortString only matches exact uppercase strings. The following calls return an invalid status:

auto insert = RowKind::FromShortString("+i");
auto update_before = RowKind::FromShortString("-u");
auto update_after = RowKind::FromShortString("+u");
auto delete_kind = RowKind::FromShortString("-d");

Expected: these lowercase short strings should be parsed successfully, consistent with Java Paimon.
Actual: they are rejected as unsupported short strings.

What doesn't meet your expectations?

Expected behavior:

  • "+i" should map to INSERT
  • "-u" should map to UPDATE_BEFORE
  • "+u" should map to UPDATE_AFTER
  • "-d" should map to DELETE

Actual behavior:

  • "+i", "-u", "+u", and "-d" return an invalid status.

Anything else?

No response

Are you willing to submit a PR?

  • I'm willing to submit a PR!

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