Github user clockfly commented on a diff in the pull request:

    https://github.com/apache/spark/pull/12872#discussion_r61986232
  
    --- Diff: 
sql/core/src/main/scala/org/apache/spark/sql/execution/command/views.scala ---
    @@ -55,13 +60,18 @@ case class CreateViewCommand(
       require(tableDesc.tableType == CatalogTableType.VIEW)
       require(tableDesc.viewText.isDefined)
     
    -  private val tableIdentifier = tableDesc.identifier
    -
       if (allowExisting && replace) {
         throw new AnalysisException(
           "It is not allowed to define a view with both IF NOT EXISTS and OR 
REPLACE.")
       }
     
    +  // Temporary view names should NOT contain database prefix like 
"database.table"
    +  if (isTemporary && tableDesc.identifier.database.isDefined) {
    +    val database = tableDesc.identifier.database.get
    +    throw new AnalysisException(
    --- End diff --
    
    This is to be consistent with DataSet API. When registering a temp table, 
it will remove the database prefix, here is the code:
    
https://github.com/apache/spark/blob/6ba17cd147277a20a7fbb244c040e694de486c36/sql/core/src/main/scala/org/apache/spark/sql/SparkSession.scala#L533



---
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

Reply via email to