Skip to content

[codegen] Fix floating point record equaliser semantics#8534

Open
thswlsqls wants to merge 2 commits into
apache:masterfrom
thswlsqls:fix/codegen-floating-point-equaliser
Open

[codegen] Fix floating point record equaliser semantics#8534
thswlsqls wants to merge 2 commits into
apache:masterfrom
thswlsqls:fix/codegen-floating-point-equaliser

Conversation

@thswlsqls

@thswlsqls thswlsqls commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Purpose

fix #8532

  • Generate Float.compare(...) == 0 and Double.compare(...) == 0 for floating-point RecordEqualiser fields.
  • Use the same floating-point comparison in nested generated scalar equality.
  • Disable raw BinaryRow.equals() / BinaryArray.equals() fast paths for compared type trees containing FLOAT or DOUBLE.
  • Match map keys with generated equality when the key type tree contains floating-point fields.
  • Keeps NaN, non-canonical NaN payloads, and signed-zero equality consistent with generated comparators after PR [codegen] Fix wrong sort order for float and double columns with nan #8295.

Tests

  • Added EqualiserCodeGeneratorTest#testFloatingPointEqualiserMatchesJdkComparison for NaN, non-canonical NaN payloads, signed zero, infinities, nested arrays, map keys, null map keys, GenericRow, hybrid rows, and BinaryRow/BinaryRow.
  • mvn -pl paimon-codegen -DwildcardSuites=none -DfailIfNoTests=false -Dtest=EqualiserCodeGeneratorTest#testFloatingPointEqualiserMatchesJdkComparison test passed, 1 test.
  • mvn -pl paimon-codegen -DwildcardSuites=none -DfailIfNoTests=false -Dtest=EqualiserCodeGeneratorTest#testFloatingPointEqualiserMatchesJdkComparison clean install passed, including compile, checkstyle, spotless, shade, install, and the regression test in both surefire phases.

Use JDK floating-point comparison for generated FLOAT and DOUBLE equality so RecordEqualiser handles NaN and signed zero consistently with generated comparators.

Generated-by: Claude Code
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Floating point record equaliser uses primitive equality

1 participant