Skip to content

[Bug] Generated RecordEqualiser treats null array elements and null map values as unequal #9859

Description

@thswlsqls

Search before asking

  • I searched in the issues and found nothing similar.

Paimon version
master @ 2bbdb66 (2.2-SNAPSHOT)

Compute Engine
Engine-agnostic

Minimal reproduce step
A generated RecordEqualiser returns false for ARRAY<INT> [1, null] vs [1, null] and for MAP<INT, INT> {1 -> null} vs {1 -> null}.

ScalarOperatorGens.generateArrayComparison (element check) and generateMapComparison (both value checks) read only the result flag of generateEquals, which stays false when either operand is null. Map keys and EqualiserCodeGenerator top-level fields treat null == null as equal.

#1214 introduced the element and HashMap value checks; #8534 added the pairwise map path with null-safe key matching but the same flag-only value check.

What doesn't meet your expectations?
Two null elements or two null map values should compare equal.

Anything else?
Production inputs (KeyValueSerializer.fromRow, LookupLevels) are not BinaryRow/BinaryArray, so they always hit this branch. With changelog-producer.row-deduplicate=true, LookupChangelogMergeFunctionWrapper emits a spurious -U/+U pair for an unchanged [1, null] or {1 -> null} value; FieldCollectAgg/FieldNestedUpdateAgg share the equaliser.

Are you willing to submit a PR?

  • I'm willing to submit a PR!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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