[Bug]: Configurations.equals is asymmetric for different key sets

Aperta
#4,482 1 commento 0 reazioni 1 assegnatario Vedi su GitHub

I maintainer di solito rispondono entro 2 giorni

@sivakumar-mahalingam ci sta già lavorando.

Dal 9/11/2026.

  • #4483 di @sivakumar-mahalingam — aperta

Valutazione

Questa issue non è ancora stata valutata.

Descrizione

type:bug
What happened?

Configurations.equals() does not compare the number of configuration entries. It only checks whether every entry in the left-hand object exists with the same value in the right-hand object.

As a result, equality is asymmetric:

small.equals(large) = true
large.equals(small) = false

It can also report two objects as equal even though their hash codes differ, violating the Java equals/hashCode contract.

A related problem occurs when comparing byte-array configurations with different keys: otherVal is null, and calling otherVal.getClass() throws a NullPointerException.

Affects Versions

master

What table formats are you seeing the problem on?

Iceberg, Paimon, Mixed-Iceberg, Mixed-Hive

What engines are you seeing the problem on?

No response

How to reproduce

There is no AMS log output because the issue is a deterministic Java equality error. The relevant reproduction output is:

small.equals(large) = true
large.equals(small) = false
small.hashCode() = 97
large.hashCode() = 3

For byte-array values:

java.lang.NullPointerException
    at org.apache.amoro.config.Configurations.equals(Configurations.java:670)
Relevant log output

Anything else

No response

Are you willing to submit a PR?
  • Yes I am willing to submit a PR!
Code of Conduct
  • I agree to follow this project's Code of Conduct
Lingua principale
Java
Stelle
1.2k
Fork
398
Merge medio
3g 7h
PR unite (30g)
15

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di apache/amoro

Tutte le issue di apache/amoro

Issue simili

Altre issue su Java

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.