Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
yuchenhuo committed Jan 24, 2020
1 parent e59a38a commit 600d289
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class CatalogV2UtilSuite extends SparkFunSuite {
assert(r.isDefined)
assert(r.get.isInstanceOf[DataSourceV2Relation])
val v2Relation = r.get.asInstanceOf[DataSourceV2Relation]
assert(v2Relation.catalog == testCatalog)
assert(v2Relation.identifier == ident)
assert(v2Relation.catalog.exists(_ == testCatalog))
assert(v2Relation.identifier.exists(_ == ident))
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@ class DataFrameWriterV2Suite extends QueryTest with SharedSparkSession with Befo
catalogPlugin: TableCatalog = catalog("testcat")): Unit = {
assert(plan.isInstanceOf[DataSourceV2Relation])
val v2 = plan.asInstanceOf[DataSourceV2Relation]
assert(v2.identifier.name() == identifier)
assert(v2.catalog == catalogPlugin)
assert(v2.identifier.exists(_.name() == identifier))
assert(v2.catalog.exists(_ == catalogPlugin))
}

test("Append: basic append") {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -257,8 +257,8 @@ class SupportsCatalogOptionsSuite extends QueryTest with SharedSparkSession with
catalogPlugin: TableCatalog = catalog(catalogName)): Unit = {
assert(plan.isInstanceOf[DataSourceV2Relation])
val v2 = plan.asInstanceOf[DataSourceV2Relation]
assert(v2.identifier.name() == identifier)
assert(v2.catalog == catalogPlugin)
assert(v2.identifier.exists(_.name() == identifier))
assert(v2.catalog.exists(_ == catalogPlugin))
}

private def load(name: String, catalogOpt: Option[String]): DataFrame = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ class TableCapabilityCheckSuite extends AnalysisSuite with SharedSparkSession {

test("AppendData: check missing capabilities") {
val plan = AppendData.byName(
DataSourceV2Relation.create(CapabilityTable(), None, mockIdent, emptyMap),
DataSourceV2Relation.create(CapabilityTable(), None, None, emptyMap),
TestRelation)

val exc = intercept[AnalysisException]{
Expand All @@ -104,7 +104,7 @@ class TableCapabilityCheckSuite extends AnalysisSuite with SharedSparkSession {
test("AppendData: check correct capabilities") {
Seq(BATCH_WRITE, V1_BATCH_WRITE).foreach { write =>
val plan = AppendData.byName(
DataSourceV2Relation.create(CapabilityTable(write), None, mockIdent, emptyMap),
DataSourceV2Relation.create(CapabilityTable(write), None, None, emptyMap),
TestRelation)

TableCapabilityCheck.apply(plan)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1103,14 +1103,14 @@ class PlanResolutionSuite extends AnalysisTest {
val tableIdent = if (isSessionCatlog) "v2Table" else "tab"
parsed match {
case AlterTable(_, _, r: DataSourceV2Relation, _) =>
assert(r.catalog == catlogIdent)
assert(r.identifier.name() == tableIdent)
assert(r.catalog.exists(_ == catlogIdent))
assert(r.identifier.exists(_.name() == tableIdent))
case Project(_, r: DataSourceV2Relation) =>
assert(r.catalog == catlogIdent)
assert(r.identifier.name() == tableIdent)
assert(r.catalog.exists(_ == catlogIdent))
assert(r.identifier.exists(_.name() == tableIdent))
case InsertIntoStatement(r: DataSourceV2Relation, _, _, _, _) =>
assert(r.catalog == catlogIdent)
assert(r.identifier.name() == tableIdent)
assert(r.catalog.exists(_ == catlogIdent))
assert(r.identifier.exists(_.name() == tableIdent))
case DescribeRelation(r: ResolvedTable, _, _) =>
assert(r.catalog == catlogIdent)
assert(r.identifier.name() == tableIdent)
Expand Down

0 comments on commit 600d289

Please sign in to comment.