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

オープン
#4,482 コメント 1 件 リアクション 0 件 担当者 1 名 GitHub で見る

メンテナーはふだん 2 日以内に返信

@sivakumar-mahalingam がすでに取り組んでいます。

2026年11月9日 から。

  • #4483 @sivakumar-mahalingam による — オープン

評価

この issue はまだ評価されていません。

説明

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
主要言語
Java
スター
1.2k
フォーク
398
平均マージ
3日 7時間
マージ済み PR(30日)
15

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

apache/amoro のほかの issue

apache/amoro の issue をすべて見る

似ている issue

Java の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。