[GitHub] [spark] dongjoon-hyun commented on a change in pull request #25149: [SPARK-28383][SQL] SHOW CREATE TABLE is not supported on a temporary view

2019-08-11 Thread GitBox
dongjoon-hyun 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_r312776947
 
 

 ##
 File path: 
sql/core/src/test/scala/org/apache/spark/sql/execution/SQLViewSuite.scala
 ##
 @@ -159,7 +159,9 @@ abstract class SQLViewSuite extends QueryTest with 
SQLTestUtils {
 
Thread.currentThread().getContextClassLoader.getResource("data/files/employee.dat")
   assertNoSuchTable(s"""LOAD DATA LOCAL INPATH "$dataFilePath" INTO TABLE 
$viewName""")
   assertNoSuchTable(s"TRUNCATE TABLE $viewName")
-  assertNoSuchTable(s"SHOW CREATE TABLE $viewName")
+  intercept[AnalysisException] {
 
 Review comment:
   As you know already, we need to check the actual error message always 
because `AnalysisException` can hide the regressions.


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



[GitHub] [spark] dongjoon-hyun commented on a change in pull request #25149: [SPARK-28383][SQL] SHOW CREATE TABLE is not supported on a temporary view

2019-08-11 Thread GitBox
dongjoon-hyun 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_r312776831
 
 

 ##
 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:
   Hi, @wangyum .
   I know that this `TODO` is not generated in this PR, but this is a good 
change to make this to `IDed TODO`. It will help the other contributors pick up 
this issue. Could you file a JIRA for this and use that JIRA ID here, please?


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