wangyum commented on a change in pull request #25149: [SPARK-28383][SQL] SHOW 
CREATE TABLE is not supported on a temporary view
URL: https://github.com/apache/spark/pull/25149#discussion_r312814019
 
 

 ##########
 File path: 
sql/core/src/main/scala/org/apache/spark/sql/execution/command/tables.scala
 ##########
 @@ -949,16 +949,22 @@ case class ShowCreateTableCommand(table: 
TableIdentifier) extends RunnableComman
 
   override def run(sparkSession: SparkSession): Seq[Row] = {
     val catalog = sparkSession.sessionState.catalog
-    val tableMetadata = catalog.getTableMetadata(table)
-
-    // TODO: unify this after we unify the CREATE TABLE syntax for hive serde 
and data source table.
-    val stmt = if (DDLUtils.isDatasourceTable(tableMetadata)) {
-      showCreateDataSourceTable(tableMetadata)
+    if (catalog.isTemporaryTable(table)) {
+      throw new AnalysisException(
+        s"SHOW CREATE TABLE is not supported on a temporary view: 
${table.identifier}")
     } else {
-      showCreateHiveTable(tableMetadata)
-    }
+      val tableMetadata = catalog.getTableMetadata(table)
 
-    Seq(Row(stmt))
+      // TODO: unify this after we unify the
 
 Review comment:
   Done: https://issues.apache.org/jira/browse/SPARK-28692

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to