Repository: spark
Updated Branches:
  refs/heads/master 358e7bf65 -> 111c05538


Added inline comment for the canEqual PR by @cloud-fan.


Project: http://git-wip-us.apache.org/repos/asf/spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/111c0553
Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/111c0553
Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/111c0553

Branch: refs/heads/master
Commit: 111c05538d9dcee06e918dcd4481104ace712dc3
Parents: 358e7bf
Author: Reynold Xin <[email protected]>
Authored: Thu Jul 16 23:13:06 2015 -0700
Committer: Reynold Xin <[email protected]>
Committed: Thu Jul 16 23:13:06 2015 -0700

----------------------------------------------------------------------
 sql/catalyst/src/main/scala/org/apache/spark/sql/Row.scala | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/spark/blob/111c0553/sql/catalyst/src/main/scala/org/apache/spark/sql/Row.scala
----------------------------------------------------------------------
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 5f0592d..3623fef 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


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

Reply via email to