Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
remove the customer equality
  • Loading branch information
cloud-fan committed Feb 23, 2018
commit fc29f8f7b5aa1bd33f5b4aa1ffd73bd9d84afc15
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@

package org.apache.spark.sql.execution.datasources.v2

import java.util.Objects

import org.apache.commons.lang3.StringUtils

import org.apache.spark.sql.catalyst.expressions.Attribute
Expand Down Expand Up @@ -63,22 +61,6 @@ trait DataSourceV2QueryPlan {
case _ => Set.empty
}

/**
* The metadata of this data source query plan that can be used for equality check.
*/
private def metadata: Seq[Any] = Seq(source.getClass, output, options, filters)

def canEqual(other: Any): Boolean

override def equals(other: Any): Boolean = other match {
case other: DataSourceV2QueryPlan => canEqual(other) && metadata == other.metadata
case _ => false
}

override def hashCode(): Int = {
metadata.map(Objects.hashCode).foldLeft(0)((a, b) => 31 * a + b)
}

private def sourceName: String = source match {
case registered: DataSourceRegister => registered.shortName()
case _ => source.getClass.getSimpleName.stripSuffix("$")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@ case class DataSourceV2Relation(

import DataSourceV2Relation._

override def canEqual(other: Any): Boolean = other.isInstanceOf[DataSourceV2Relation]

override def simpleString: String = "V2Relation " + metadataString

override lazy val schema: StructType = reader.readSchema()
Expand Down Expand Up @@ -121,8 +119,6 @@ case class StreamingDataSourceV2Relation(

override def isStreaming: Boolean = true

override def canEqual(other: Any): Boolean = other.isInstanceOf[StreamingDataSourceV2Relation]

override def simpleString: String = "Streaming V2Relation " + metadataString

override def newInstance(): LogicalPlan = copy(output = output.map(_.newInstance()))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,6 @@ case class DataSourceV2ScanExec(
@transient reader: DataSourceReader)
extends LeafExecNode with DataSourceV2QueryPlan with ColumnarBatchScan {

override def canEqual(other: Any): Boolean = other.isInstanceOf[DataSourceV2ScanExec]

override def simpleString: String = "V2Scan " + metadataString

override def outputPartitioning: physical.Partitioning = reader match {
Expand Down