This is an automated email from the ASF dual-hosted git repository.
voonhous pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hudi.git
The following commit(s) were added to refs/heads/master by this push:
new 88d34dc77146 fix(spark): correct self-recursive equals in
ProcedureParameterImpl (#19167)
88d34dc77146 is described below
commit 88d34dc77146aafabb719ed24c84b3dd4ec3afdf
Author: Y Ethan Guo <[email protected]>
AuthorDate: Sat Jul 4 02:50:10 2026 -0700
fix(spark): correct self-recursive equals in ProcedureParameterImpl (#19167)
equals() called this == other, which dispatches back to equals() and
recurses to a StackOverflowError, and it cast other to
ProcedureParameterImpl before the null/type guard, throwing
ClassCastException for a wrong-type argument. Use reference equality for
the identity check and move the cast after the guard.
---
.../spark/sql/hudi/command/procedures/ProcedureParameterImpl.scala | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git
a/hudi-spark-datasource/hudi-spark/src/main/scala/org/apache/spark/sql/hudi/command/procedures/ProcedureParameterImpl.scala
b/hudi-spark-datasource/hudi-spark/src/main/scala/org/apache/spark/sql/hudi/command/procedures/ProcedureParameterImpl.scala
index a7f411704745..f5ff30c1b90b 100644
---
a/hudi-spark-datasource/hudi-spark/src/main/scala/org/apache/spark/sql/hudi/command/procedures/ProcedureParameterImpl.scala
+++
b/hudi-spark-datasource/hudi-spark/src/main/scala/org/apache/spark/sql/hudi/command/procedures/ProcedureParameterImpl.scala
@@ -25,15 +25,14 @@ case class ProcedureParameterImpl(index: Int, name: String,
dataType: DataType,
extends ProcedureParameter {
override def equals(other: Any): Boolean = {
- val that = other.asInstanceOf[ProcedureParameterImpl]
- val rtn = if (this == other) {
+ if (this eq other.asInstanceOf[AnyRef]) {
true
} else if (other == null || (getClass ne other.getClass)) {
false
} else {
+ val that = other.asInstanceOf[ProcedureParameterImpl]
index == that.index && required == that.required && default ==
that.default && Objects.equals(name, that.name) && Objects.equals(dataType,
that.dataType)
}
- rtn
}
override def hashCode: Int = Seq(index, name, dataType, required,
default).hashCode()