Skip to content

Commit

Permalink
address comments from yhuai
Browse files Browse the repository at this point in the history
  • Loading branch information
cloud-fan committed Oct 9, 2016
1 parent 96833d5 commit fb96f1c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Expand Up @@ -199,7 +199,8 @@ class SessionCatalog(
if (dbName == globalTempViewManager.database) {
throw new AnalysisException(
s"${globalTempViewManager.database} is a system preserved database, " +
"you cannot use it as current database.")
"you cannot use it as current database. To access global temporary views, you should " +
s"use qualified name, e.g. ${globalTempViewManager.database}.viewName.")
}
requireDbExists(dbName)
synchronized { currentDb = dbName }
Expand Down
Expand Up @@ -183,7 +183,8 @@ case class DropTableCommand(

override def run(sparkSession: SparkSession): Seq[Row] = {
val catalog = sparkSession.sessionState.catalog
if (tableName.database.forall(catalog.databaseExists) && catalog.tableExists(tableName)) {

if (!catalog.isTemporaryTable(tableName) && catalog.tableExists(tableName)) {
// If the command DROP VIEW is to drop a table or DROP TABLE is to drop a view
// issue an exception.
catalog.getTableMetadata(tableName).tableType match {
Expand Down

0 comments on commit fb96f1c

Please sign in to comment.