diff options
author | Reynold Xin <rxin@databricks.com> | 2015-07-16 23:13:06 -0700 |
---|---|---|
committer | Reynold Xin <rxin@databricks.com> | 2015-07-16 23:13:06 -0700 |
commit | 111c05538d9dcee06e918dcd4481104ace712dc3 (patch) | |
tree | c3db5d3bc6dfc380336bccaa77648a177fb97cb3 /sql | |
parent | 358e7bf652d6fedd9377593025cd661c142efeca (diff) | |
download | spark-111c05538d9dcee06e918dcd4481104ace712dc3.tar.gz spark-111c05538d9dcee06e918dcd4481104ace712dc3.tar.bz2 spark-111c05538d9dcee06e918dcd4481104ace712dc3.zip |
Added inline comment for the canEqual PR by @cloud-fan.
Diffstat (limited to 'sql')
-rw-r--r-- | sql/catalyst/src/main/scala/org/apache/spark/sql/Row.scala | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/sql/catalyst/src/main/scala/org/apache/spark/sql/Row.scala b/sql/catalyst/src/main/scala/org/apache/spark/sql/Row.scala index 5f0592dc1d..3623fefbf2 100644 --- a/sql/catalyst/src/main/scala/org/apache/spark/sql/Row.scala +++ b/sql/catalyst/src/main/scala/org/apache/spark/sql/Row.scala @@ -364,8 +364,13 @@ trait Row extends Serializable { false } - protected def canEqual(other: Any) = + protected def canEqual(other: Any) = { + // Note that InternalRow overrides canEqual. These two canEqual's together makes sure that + // comparing the external Row and InternalRow will always yield false. + // In the future, InternalRow should not extend Row. In that case, we can remove these + // canEqual methods. other.isInstanceOf[Row] && !other.isInstanceOf[InternalRow] + } override def equals(o: Any): Boolean = { if (o == null || !canEqual(o)) return false |