Github user zsxwing commented on a diff in the pull request:

    https://github.com/apache/spark/pull/7825#discussion_r36187270
  
    --- Diff: 
extras/kinesis-asl/src/main/scala/org/apache/spark/streaming/kinesis/KinesisBackedBlockRDD.scala
 ---
    @@ -39,8 +39,15 @@ case class SequenceNumberRange(
     private[kinesis]
     case class SequenceNumberRanges(ranges: Array[SequenceNumberRange]) {
       def isEmpty(): Boolean = ranges.isEmpty
    +
       def nonEmpty(): Boolean = ranges.nonEmpty
    +
       override def toString(): String = 
ranges.mkString("SequenceNumberRanges(", ", ", ")")
    +
    +  override def equals(obj: Any): Boolean = {
    --- End diff --
    
    This `equals` seems only for testing. However, it doesn't follow the 
contract of `equals`, such as handling `null`. In addition, `equals` and 
`hashCode` should be implemented together.
    
    Actually, we should not use an `Array` as a field of case class. How about 
changing it to `Seq`? 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to