cloud-fan commented on a change in pull request #27984: [SPARK-31224][SQL] Add
view support to SHOW CREATE TABLE
URL: https://github.com/apache/spark/pull/27984#discussion_r402823718
##########
File path:
sql/core/src/main/scala/org/apache/spark/sql/execution/command/tables.scala
##########
@@ -1109,21 +1145,33 @@ case class ShowCreateTableCommand(table:
TableIdentifier)
)
}
- if (tableMetadata.tableType == VIEW) {
- throw new AnalysisException("Hive view isn't supported by SHOW
CREATE TABLE")
- }
-
if
("true".equalsIgnoreCase(tableMetadata.properties.getOrElse("transactional",
"false"))) {
throw new AnalysisException(
"SHOW CREATE TABLE doesn't support transactional Hive table. " +
s"Please use `SHOW CREATE TABLE ${tableMetadata.identifier} AS
SERDE` " +
"to show Hive DDL instead.")
}
- convertTableMetadata(tableMetadata)
+ if (tableMetadata.tableType == VIEW) {
Review comment:
I think we should put it in a higher level
```
val metadata = if (DDLUtils.isDatasourceTable(tableMetadata) ||
tableMetadata.tableType == VIEW) {
tableMetadata
} else {
...
```
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]