You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spark.apache.org by rx...@apache.org on 2015/08/14 07:06:12 UTC

spark git commit: [MINOR] [SQL] Remove canEqual in Row

Repository: spark
Updated Branches:
  refs/heads/master bd35385d5 -> 7c7c7529a


[MINOR] [SQL] Remove canEqual in Row

As `InternalRow` does not extend `Row` now, I think we can remove it.

Author: Liang-Chi Hsieh <vi...@appier.com>

Closes #8170 from viirya/remove_canequal.


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

Branch: refs/heads/master
Commit: 7c7c7529a16c0e79778e522a3df82a0f1c3762a3
Parents: bd35385
Author: Liang-Chi Hsieh <vi...@appier.com>
Authored: Thu Aug 13 22:06:09 2015 -0700
Committer: Reynold Xin <rx...@databricks.com>
Committed: Thu Aug 13 22:06:09 2015 -0700

----------------------------------------------------------------------
 .../main/scala/org/apache/spark/sql/Row.scala   | 21 --------------------
 1 file changed, 21 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/spark/blob/7c7c7529/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 40159aa..ec895af 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,31 +364,10 @@ trait Row extends Serializable {
     false
   }
 
-  /**
-   * Returns true if we can check equality for these 2 rows.
-   * Equality check between external row and internal row is not allowed.
-   * Here we do this check to prevent call `equals` on external row with internal row.
-   */
-  protected def canEqual(other: Row) = {
-    // Note that `Row` is not only the interface of external row but also the parent
-    // of `InternalRow`, so we have to ensure `other` is not a internal row here to prevent
-    // call `equals` on external row with internal row.
-    // `InternalRow` overrides canEqual, and these two canEquals together makes sure that
-    // equality check between external Row and InternalRow will always fail.
-    // In the future, InternalRow should not extend Row. In that case, we can remove these
-    // canEqual methods.
-    !other.isInstanceOf[InternalRow]
-  }
-
   override def equals(o: Any): Boolean = {
     if (!o.isInstanceOf[Row]) return false
     val other = o.asInstanceOf[Row]
 
-    if (!canEqual(other)) {
-      throw new UnsupportedOperationException(
-        "cannot check equality between external and internal rows")
-    }
-
     if (other eq null) return false
 
     if (length != other.length) {


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@spark.apache.org
For additional commands, e-mail: commits-help@spark.apache.org