Skip to content

Commit

Permalink
[SPARK-23275] hive/tests have been failing when run locally on the la…
Browse files Browse the repository at this point in the history
…ptop (Mac) with OOM
  • Loading branch information
dilipbiswal committed Jan 30, 2018
1 parent a23187f commit 983aa18
Showing 1 changed file with 11 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -825,23 +825,19 @@ private[hive] class HiveClientImpl(
}

def reset(): Unit = withHiveState {
try {
client.getAllTables("default").asScala.foreach { t =>
logDebug(s"Deleting table $t")
val table = client.getTable("default", t)
client.getIndexes("default", t, 255).asScala.foreach { index =>
shim.dropIndex(client, "default", t, index.getIndexName)
}
if (!table.isIndexTable) {
client.dropTable("default", t)
}
client.getAllTables("default").asScala.foreach { t =>
logDebug(s"Deleting table $t")
val table = client.getTable("default", t)
client.getIndexes("default", t, 255).asScala.foreach { index =>
shim.dropIndex(client, "default", t, index.getIndexName)
}
client.getAllDatabases.asScala.filterNot(_ == "default").foreach { db =>
logDebug(s"Dropping Database: $db")
client.dropDatabase(db, true, false, true)
if (!table.isIndexTable) {
client.dropTable("default", t)
}
} finally {
runSqlHive("USE default")
}
client.getAllDatabases.asScala.filterNot(_ == "default").foreach { db =>
logDebug(s"Dropping Database: $db")
client.dropDatabase(db, true, false, true)
}
}
}
Expand Down

0 comments on commit 983aa18

Please sign in to comment.