Skip to content

Commit e3816d7

Browse files
committed
Add custom hcode quickly
1 parent 941e64f commit e3816d7

File tree

1 file changed

+4
-0
lines changed
  • src/main/scala/com/high-performance-spark-examples/dataframe

1 file changed

+4
-0
lines changed

src/main/scala/com/high-performance-spark-examples/dataframe/RawPandas.scala

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ case class RawPanda(id: Long, zip: String, pt: String, happy: Boolean, attribute
1212
happy == other.happy && attributes.deep == other.attributes.deep)
1313
case _ => false
1414
}
15+
override def hashCode(): Int = {
16+
3 * Objects.hashCode(id) + 7 * Objects.hashCode(zip) + 11 * Objects.hashCode(pt) +
17+
13 * Arrays.hashCode(attributes)
18+
}
1519
}
1620

1721
/**

0 commit comments

Comments
 (0)