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

    https://github.com/apache/spark/pull/999#discussion_r13828440
  
    --- Diff: 
sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/optimizer/OptimizerTest.scala
 ---
    @@ -17,39 +17,10 @@
     
     package org.apache.spark.sql.catalyst.optimizer
     
    -import org.scalatest.FunSuite
    -
    -import org.apache.spark.sql.catalyst.expressions._
    -import org.apache.spark.sql.catalyst.plans.logical.LogicalPlan
    -import org.apache.spark.sql.catalyst.util._
    +import org.apache.spark.sql.catalyst.plans.PlanTest
     
     /**
      * Provides helper methods for comparing plans produced by optimization 
rules with the expected
      * result
      */
    -class OptimizerTest extends FunSuite {
    -
    -  /**
    -   * Since attribute references are given globally unique ids during 
analysis,
    -   * we must normalize them to check if two different queries are 
identical.
    -   */
    -  protected def normalizeExprIds(plan: LogicalPlan) = {
    -    val minId = 
plan.flatMap(_.expressions.flatMap(_.references).map(_.exprId.id)).min
    -    plan transformAllExpressions {
    -      case a: AttributeReference =>
    -        AttributeReference(a.name, a.dataType, a.nullable)(exprId = 
ExprId(a.exprId.id - minId))
    -    }
    -  }
    -
    -  /** Fails the test if the two plans do not match */
    -  protected def comparePlans(plan1: LogicalPlan, plan2: LogicalPlan) {
    -    val normalized1 = normalizeExprIds(plan1)
    -    val normalized2 = normalizeExprIds(plan2)
    -    if (normalized1 != normalized2)
    -      fail(
    -        s"""
    -          |== FAIL: Plans do not match ===
    -          |${sideBySide(normalized1.treeString, 
normalized2.treeString).mkString("\n")}
    -        """.stripMargin)
    -  }
    -}
    +class OptimizerTest extends PlanTest
    --- End diff --
    
    Is there any reason to keep this class?


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to