Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -581,9 +581,9 @@ case class HoodiePostAnalysisRule(sparkSession: SparkSession) extends Rule[Logic
if sparkAdapter.isHoodieTable(table) =>
CreateHoodieTableCommand(table, ignoreIfExists)
// Rewrite the DropTableCommand to DropHoodieTableCommand
case DropTableCommand(tableName, ifExists, isView, purge)
case DropTableCommand(tableName, ifExists, false, purge)
if sparkAdapter.isHoodieTable(tableName, sparkSession) =>
DropHoodieTableCommand(tableName, ifExists, isView, purge)
DropHoodieTableCommand(tableName, ifExists, false, purge)
// Rewrite the AlterTableDropPartitionCommand to AlterHoodieTableDropPartitionCommand
case AlterTableDropPartitionCommand(tableName, specs, ifExists, purge, retainData)
if sparkAdapter.isHoodieTable(tableName, sparkSession) =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,6 @@ class TestDropTable extends HoodieSparkSqlTestBase {
}
}


test("Drop an MANAGED table which path is lost.") {
val tableName = generateTableName
spark.sql(
Expand All @@ -341,6 +340,28 @@ class TestDropTable extends HoodieSparkSqlTestBase {
checkAnswer("show tables")()
}

test("Drop local temporary view should not fail") {
val viewName = generateTableName
spark.sql(
s"""
|create temporary view $viewName as
| select 1
|""".stripMargin)

spark.sql(s"drop view $viewName")
}

test("Drop global temporary view should not fail") {
val viewName = generateTableName
spark.sql(
s"""
|create global temporary view $viewName as
| select 1
|""".stripMargin)

spark.sql(s"drop view global_temp.$viewName")
}

private def alterSerdeProperties(sessionCatalog: SessionCatalog, tableIdt: TableIdentifier,
newProperties: Map[String, String]): Unit = {
val catalogTable = spark.sessionState.catalog.getTableMetadata(tableIdt)
Expand Down