Github user gatorsmile commented on a diff in the pull request: https://github.com/apache/spark/pull/12960#discussion_r62416962 --- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/catalog/InMemoryCatalog.scala --- @@ -59,17 +59,48 @@ class InMemoryCatalog extends ExternalCatalog { } } + private def requireFunctionNotFound(db: String, funcName: String): Unit = { + if (functionExists(db, funcName)) { + throw new AnalysisException( + s"Function already exists: '$funcName' exists in database '$db'") + } + } + private def requireTableExists(db: String, table: String): Unit = { if (!tableExists(db, table)) { throw new AnalysisException( s"Table or view not found: '$table' does not exist in database '$db'") } } - private def requirePartitionExists(db: String, table: String, spec: TablePartitionSpec): Unit = { - if (!partitionExists(db, table, spec)) { + private def requireTableNotFound(db: String, table: String): Unit = { + if (tableExists(db, table)) { throw new AnalysisException( - s"Partition not found: database '$db' table '$table' does not contain: '$spec'") + s"Table or view exists: '$table' exists in database '$db'") + } + } + + private def requirePartitionExists( --- End diff -- Change it now. Thanks!
--- 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. --- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org